note 679 deleted from eval by jmoore
| From: | jmoore@php.net | Date: | Tue, 15 Aug 2000 00:07:10 +0000 |
| Subject: | note 679 deleted from eval by jmoore | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-1847@lists.php.net to get a copy of this message | ||
Be careful of using eval with while. For instance:<br><code><pre><dd>
$string=file("blah.inc");</dd><dd>
while(list($null,$val)=each($string))</dd><dd> eval($val);</dd></pre></code><br>will
not execute right. The proper way to do this is:<br><code><pre><dd>
$string=file("blah.inc");</dd><dd>
while(list($null,$val)=each($string))
{</dd><dd> eval($val);</dd><dd>
}</dd></pre></code>