#25375 [Fbk->Csd]: Crash at redeclaring class attempt within foreach (too fatal error)

From: Date: Thu, 13 Nov 2003 07:30:04 +0000
Subject: #25375 [Fbk->Csd]: Crash at redeclaring class attempt within foreach (too fatal error)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-50318@lists.php.net to get a copy of this message
ID: 25375 User updated by: forseti at oak dot rpg dot pl Reported By: forseti at oak dot rpg dot pl -Status: Feedback +Status: Closed Bug Type: Reproducible crash Operating System: Windows 98 SE PHP Version: 5CVS-2003-09-03 (dev) New Comment: With latest (12-Nov) version all seems to be ok Previous Comments: ------------------------------------------------------------------------ [2003-11-10 20:32:26] iliaa@php.net 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 ------------------------------------------------------------------------ [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

« previous php.bugs (#50318) next »