Re: Easier way to get the name of a variable?
| From: | Richard Lynch | Date: | Wed, 16 Aug 2006 21:19:14 +0000 |
| Subject: | Re: Easier way to get the name of a variable? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-240789@lists.php.net to get a copy of this message | ||
On Tue, August 15, 2006 7:01 pm, Larry Garfield wrote:
> On Tuesday 15 August 2006 16:50, Richard Lynch wrote:
>
>> If the names are not predictable, the array solution is probably
>> best,
>> as there is movement in the PHP Internals list that may (or may not)
>> make it impossible to dynamically add a property to an object. I've
>> lost track of where that thread ended, so apologies if this is a
>> non-issue.
>
> Gah! Please tell me you're joking. That would kill one of PHP's best
> features, the fact that you can have dynamic data structures.
>
> PHP != Java!!!
I was partly wrong.
This would only apply (if it applies at all) for static vars.
class foo { };
$foo = new foo;
foo->whatever = 5; //ok
foo::something = 5; //E_STRICT error, maybe, depending on Internals
flamewar outcome...
Richard "Swiss cheese memory" Lynch :-)
--
Like Music?
http://l-i-e.com/artists.htm