RE: [PHP] Re: IS THIS A BUG?
| From: | Martin Towell | Date: | Thu, 28 Aug 2003 00:36:03 +0000 |
| Subject: | RE: [PHP] Re: IS THIS A BUG? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-160989@lists.php.net to get a copy of this message | ||
And also for class names
$foo = "bar";
$blah = new $foo();
$blah would be a new instance of the class bar
I've actually used the above, but it was a special case.. I wouldn't
normally use it.
-----Original Message-----
From: DvDmanDT [mailto:dvdmandt@telia.com]
Sent: Thursday, 28 August 2003 8:58 AM
To: php-general@lists.php.net
Subject: [PHP] Re: IS THIS A BUG?
I also wanna add that it works for functions as well:
$foo="bar";
$foo();
would call the function bar()... I read this in the manual at some point
like a year ago... This isn't something I would recommend using as you could
in 90% of the cases screw it all badly... Could be useful sometimes though
(I got an example, but I'm a bit lazy...)
--
// DvDmanDT
MSN: dvdmandt@hotmail.com
Mail: dvdmandt@telia.com
"Steve Todd" <steve_todd@blueyonder.co.uk> skrev i meddelandet
news:000501c36cd9$ad9bae70$4d782a52@speedchild...
> Is it possible to define a variable, such as:
> $foo = "bar";
>
> and then do as follows to create a totally different variable:
> $$foo = "text here";
>
> this seems to mean $bar = "text here";.
>
> Is this a bug or can we legally use it.
>
> Steve
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__________ Information from NOD32 1.490 (20030820) __________
This message was checked by NOD32 for Exchange e-mail monitor.
http://www.nod32.com