ID:               28574
 Updated by:       [EMAIL PROTECTED]
 Reported By:      webroom at quicknet dot nl
-Status:           Open
+Status:           Closed
 Bug Type:         Reproducible crash
 Operating System: Windows
 PHP Version:      4.3.5
 New Comment:

Does not happen with latest CVS, a correct warning:  
Invalid argument supplied for foreach() is being displayed. 


Previous Comments:
------------------------------------------------------------------------

[2004-05-30 12:38:43] webroom at quicknet dot nl

Description:
------------
Hi,

When I recently with my project used a foreach with a string,
consequently not with an array, apache spontaneously crashed. An
example could be found by reproduce code.

I use:

Apache 2.0.44
PHP 4.3.5 (yep, sorry, not the newest one...)
Windows XP Proffesional SP1 English

PHP is installed as an Apache module. (not CGI)

Reproduce code:
---------------
<?php

// P.S. The code that I used in my project was to big, and I don't have
a server to place it. So I use an example.

$string = "Line 1 of the string
This is line 2 so as you can see.
And also line 3.";

foreach ($string AS $key => $line) {
   
   // Do some actions..
   
}

?>

Expected result:
----------------
Well, is should expect an array from PHP with: Can only use arrays in
foreach loops or something.

Actual result:
--------------
Apache crashed as I already said.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28574&edit=1

Reply via email to