PHP 4.0 Bug #3938: reset(nonvariable) causes execution failure
| From: | jeremiah at emphasys dot net | Date: | Mon, 27 Mar 2000 22:12:24 +0000 |
| Subject: | PHP 4.0 Bug #3938: reset(nonvariable) causes execution failure | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-17298@lists.php.net to get a copy of this message | ||
From: jeremiah@emphasys.net
Operating system: Redhat 6.1
PHP version: 4.0 Beta 4 Patch Level 1
PHP Bug Type: Scripting Engine problem
Bug description: reset(nonvariable) causes execution failure
<?php
$test = array('one','two','three');
reset(test);
/*
** The above reset() causes script execution to fail, no output from script.
** This was hard to find when buried in large script with no output to debug.
** Produces the following warning in PHP3
** Warning: Cannot pass expression as argument 1 by reference
*/
while(list($key,$value) = each($test)) {
echo "$key => $value<br>\n";
}
?>