Re: Code Advice
| From: | Kevin Stone | Date: | Wed, 06 Nov 2002 19:36:00 +0000 |
| Subject: | Re: Code Advice | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-123057@lists.php.net to get a copy of this message | ||
Oh ho! Good call Mr. Vogelsinger. I would never have guessed. So infact
the code DOES work. My apologies Jason, I guess ya learn something new
every day. ;-)
-Kevin
----- Original Message -----
From: "Ernest E Vogelsinger" <ernest@vogelsinger.at>
To: "Jason Young" <jason1@erols.com>
Cc: <php-general@lists.php.net>
Sent: Wednesday, November 06, 2002 12:31 PM
Subject: Re: [PHP] Code Advice
> At 20:13 06.11.2002, Jason Young spoke out and said:
> --------------------[snip]--------------------
> >Hmm..
> >
> >So then can anyone tell me why its working so far? ;)
> >
> >I am trying out every single function in this page in hopes to catch
> >something, but so far I don't see any breakage - I can see there are a
> >few ways to skin this cat.. the original code I posted DOES work.. I
> >still may be blind to any future breakings.. that's why I posted it.
> >Unfortunately, I'm getting responses saying that this code won't work
> >at all - when it does.. :-/
> --------------------[snip]--------------------
>
> Well - it's a miracle... I just tried the code you posted, and indeed PHP
> (v.4.2.2) allows numeric identifiers - BUT ONLY as long as you're
accessing
> it indirectly.
>
> Example:
> $key = 0;
> $$key = 'some data'; // works
> echo $$key; // works
> echo "Key 0: $0" // prints "$0", not the content (wrong)
> echo $0; // error "unexpected T_DNUMBER"
>
>
> --
> >O Ernest E. Vogelsinger
> (\) ICQ #13394035
> ^ http://www.vogelsinger.at/
>