From: f dot braem at skynet dot be Operating system: Win98 PHP version: 5.0.0 PHP Bug Type: Reproducible crash Bug description: foreach on class property crashes Zend Optimizer
Description: ------------ When foreach is used on a class property, Apache crashes in the Zend Optimizer. When you assign the property to a variable and use that variable in the foreach, it doesn't crash. Reproduce code: --------------- <?php class Test { public $data; function __construct() { $this->data = array(); } } $t = new Test(); $t->data = array('en' => 'english', 'nl' => 'dutch'); foreach($t->data as $key => $item) { print_r($key); echo '<br />'; print_r($item); echo '<br />'; } ?> Expected result: ---------------- en english nl dutch Actual result: -------------- Crash dump: APACHE caused an invalid page fault in module ZENDOPTIMIZER.DLL at 015f:05e76394. Registers: EAX=dc8bcf8b CS=015f EIP=05e76394 EFLGS=00010246 EBX=089ddbd0 SS=0167 ESP=037cf8b8 EBP=037cfb94 ECX=037cf8dc DS=0167 ESI=08aeb678 FS=8a27 EDX=05e86962 ES=0167 EDI=037cfb40 GS=0000 Bytes at CS:EIP: ff 40 08 c3 90 90 90 90 90 90 90 90 c7 05 ac 91 Stack dump: 05e7a541 dc8bcf8b 08aeb044 08aeb678 05e7673a 037cfb40 08aeb678 08aeb044 089ddbd0 05e86962 037cf908 bff7a541 08ae0000 bff7a558 08ae0000 00000000 -- Edit bug report at http://bugs.php.net/?id=29475&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29475&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29475&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29475&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29475&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29475&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29475&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29475&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29475&r=support Expected behavior: http://bugs.php.net/fix.php?id=29475&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29475&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29475&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29475&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29475&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29475&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29475&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29475&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29475&r=float