#34548 [Opn->Fbk]: Method 'append()' in class extended from ArrayObject crash PHP
| From: | sniper@php.net | Date: | Mon, 19 Sep 2005 11:51:06 +0000 |
| Subject: | #34548 [Opn->Fbk]: Method 'append()' in class extended from ArrayObject crash PHP | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-85234@lists.php.net to get a copy of this message | ||
ID: 34548
Updated by: sniper@php.net
Reported By: cbelin at free dot fr
-Status: Open
+Status: Feedback
Bug Type: SPL related
Operating System: Windows XP sp2
PHP Version: 5.0.5
New Comment:
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).
Previous Comments:
------------------------------------------------------------------------
[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