php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34548 Method 'append()' in class extended from ArrayObject crash PHP
Submitted: 2005-09-19 13:29 UTC Modified: 2005-09-19 21:02 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: cbelin at free dot fr Assigned: tony2001 (profile)
Status: Closed Package: SPL related
PHP Version: 5.0.5 OS: Windows XP sp2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cbelin at free dot fr
New email:
PHP Version: OS:

 

 [2005-09-19 13:29 UTC] 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)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-19 13:51 UTC] 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 14:03 UTC] 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 21:02 UTC] tony2001@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC