From: webroom at quicknet dot nl
Operating system: Windows
PHP version: 4.3.5
PHP Bug Type: Reproducible crash
Bug description: PHP crashes with a foreach.
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 bug report at http://bugs.php.net/?id=28574&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28574&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28574&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28574&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28574&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28574&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28574&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28574&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28574&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28574&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28574&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28574&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28574&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28574&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28574&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28574&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28574&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28574&r=float