ID: 25375
Updated by: iliaa@php.net
Reported By: forseti at oak dot rpg dot pl
-Status: Open
+Status: Feedback
Bug Type: Reproducible crash
Operating System: Windows 98 SE
PHP Version: 5CVS-2003-09-03 (dev)
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2003-09-03 03:59:34] forseti at oak dot rpg dot pl
Description:
------------
With PHP v. 5.0.0b2 on Win98 SE installed under Apache 1.3.22 as CGI an
attempt to call an unexisting class variable inside foreach construct
produces crash instead of error (possibly fatal).
Problem exist only when call is executed inside class declaration.
Attempt to do this outside class declaration produces expected Warning:
Invalid argument supplied for foreach() and Fatal error: Cannot
redeclare class
Reproduce code:
---------------
<?php
class Test {
var $a=array(1,2,3,4);
function __construct() {
foreach($this->b as $row) {
if($row=='foo') {
return true;
}
}
}
}
Expected result:
----------------
Warning: Invalid argument supplied for foreach() in <file> on line
<line>
Fatal error: Cannot redeclare class test in <file> on line <line>
Actual result:
--------------
a crash
from Apache log:
[error] [client 127.0.0.1] Premature end of script headers:
c:/php/php.exe
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25375&edit=1