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

From: Date: Tue, 11 Nov 2003 01:32:26 +0000
Subject: #25375 [Opn->Fbk]: Crash at redeclaring class attempt within foreach (too fatal error)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-50213@lists.php.net to get a copy of this message
 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


Thread (1 message)

  • iliaa@php.net
  • Unknown Message
    • iliaa@php.net
« previous php.bugs (#50213) next »