[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nyphp-talk
Subject:    Re: [nyphp-talk] Variable composition: ${'foo'.$i}
From:       justin <justin () justinhileman ! info>
Date:       2014-02-02 17:36:29
Message-ID: CA+3=dgHa63eaSH-1V-EH0-HPBzS0mnxhGkST+MVfTY3AqzoFQw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


ᐧ

On Fri, Jan 31, 2014 at 12:11 PM, Anthony Ferrara <ircmaxell@gmail.com>wrote:

> In short, the only form of variable-variables that I believe should
> **ever** be used are variable object property/method references:
>
> $obj->$property = blah;
> $obj->$method();
>
> Any other usage is simply mis-using variables where you should use a more
> appropriate data structure (like an array or object)...
>

I'd add:

new $className(...);

--j

[Attachment #5 (text/html)]

<div dir="ltr"><div hspace="streak-pt-mark" style="max-height:1px"><img \
style="width:0px; max-height:0px;" \
src="https://mailfoogae.appspot.com/t?sender=justinhileman%40gmail.com&amp;type=zerocontent&amp;guid=75078d25-dd31-4fd9-b798-51f7249bd363"><font \
color="#ffffff" size="1">ᐧ</font></div>

<div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 31, 2014 at 12:11 \
PM, Anthony Ferrara <span dir="ltr">&lt;<a href="mailto:ircmaxell@gmail.com" \
target="_blank">ircmaxell@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div>In short, the only form of variable-variables that I \
believe should **ever** be used are variable object property/method references:</div>

<div><br></div><div>$obj-&gt;$property = blah;</div><div>$obj-&gt;$method();</div>
<div><br></div><div>Any other usage is simply mis-using variables where you should \
use a more appropriate data structure (like an array or object)...</div><span \
class="HOEnZb"><font color="#888888"><div></div></font></span></blockquote>

</div><br>I&#39;d add:</div><div class="gmail_extra"><br></div><div \
class="gmail_extra">new $className(...);</div><div class="gmail_extra"><br></div><div \
class="gmail_extra">--j</div></div>



_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/show-participation

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic