#34548 [Fbk->Asn]: Method 'append()' in class extended from ArrayObject crash PHP

From: Date: Mon, 19 Sep 2005 12:03:17 +0000
Subject: #34548 [Fbk->Asn]: Method 'append()' in class extended from ArrayObject crash PHP
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85236@lists.php.net to get a copy of this message
ID: 34548 Updated by: tony2001@php.net Reported By: cbelin at free dot fr -Status: Feedback +Status: Assigned Bug Type: SPL related Operating System: Windows XP sp2 PHP Version: 5.0.5 -Assigned To: +Assigned To: tony2001 New Comment: Works fine with 5.1, reproducible with 5.0. I got a patch for it, will check it out with Marcus and commit soon. Previous Comments: ------------------------------------------------------------------------ [2005-09-19 13:51:05] sniper@php.net 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 Works fine for me (using Linux). ------------------------------------------------------------------------ [2005-09-19 13:29:08] cbelin at free dot fr Description: ------------ Method 'append()' in class extended from ArrayObject crash PHP with Windows message (sorry, it's in French) : php-cgi.exe - Erreur d'application L'instruction à "0x10003cfb0" emploie l'adresse mémoire "0x00000008". La mémoire ne peut pas être "read". This bug only appears when method 'offsetSet()' is redefined. Web server IIS 5.1 under Windows XP Service Pack 2. Reproduce code: --------------- class Collection extends ArrayObject { public function add($dataArray) { foreach($dataArray as $value) $this->append($value); } public function offsetSet($index, $value) { parent::offsetSet($index, $value); } } $data1=array('one', 'two', 'three'); $data2=array('four', 'five'); $foo=new Collection($data1); $foo->add($data2); print_r($foo->getArrayCopy()); Expected result: ---------------- Array ( [0] => one [1] => two [2] => three [3] => four [4] => five ) Actual result: -------------- CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: (no headers are printed) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34548&edit=1

« previous php.bugs (#85236) next »