Re: Regarding variable reference
| From: | Ulrik S. Kofod | Date: | Wed, 16 Jun 2004 05:51:48 +0000 |
| Subject: | Re: Regarding variable reference | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-188372@lists.php.net to get a copy of this message | ||
Justin Patrin sagde:
> Ulrik S. Kofod wrote:
>
> Why are you using eval? Eval is slow and is a hack... Just do:
> $y = $$x;
>
>> if(isset($y))
>> {
>> echo "<p>$x:$y</p>";
>> }
>> }
>
True ! I just tested it with both eval and $$, and $$ seems to be about 3 to 4 times
faster than eval BUT if you are processing less than 10000 variables then there is
no noticeable difference.
Sorry I suggested eval!
but I think it is easier to read the program when using eval as it is more eye
catching than just an extra $ that is easily missed.