note 679 deleted from eval by jmoore

From: 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>&nbsp;&nbsp;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>&nbsp;&nbsp;eval($val);</dd><dd> &nbsp;&nbsp;}</dd></pre></code>

« previous php.notes (#1847) next »