php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29475 foreach on class property crashes Zend Optimizer
Submitted: 2004-07-31 23:06 UTC Modified: 2004-07-31 23:29 UTC
From: f dot braem at skynet dot be Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.0.0 OS: Win98
Private report: No CVE-ID: None
 [2004-07-31 23:06 UTC] f dot braem at skynet dot be
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 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-31 23:29 UTC] gschlossnagle@php.net
You should open up problems with Zend products on the 
zend site here:http://zend.com/support/


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 28 11:00:03 2025 UTC