#34548 [Asn->Csd]: Method 'append()' in class extended from ArrayObject crash PHP
| From: | tony2001@php.net | Date: | Mon, 19 Sep 2005 19:02:02 +0000 |
| Subject: | #34548 [Asn->Csd]: Method 'append()' in class extended from ArrayObject crash PHP | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-85252@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: Assigned
+Status: Closed
Bug Type: SPL related
Operating System: Windows XP sp2
PHP Version: 5.0.5
Assigned To: tony2001
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-09-19 14:03:16] tony2001@php.net
Works fine with 5.1, reproducible with 5.0.
I got a patch for it, will check it out with Marcus and commit soon.
------------------------------------------------------------------------
[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