#49449 [Opn->Bgs]: Segmentation fault with ArrayObject::offsetSet()
| From: | mike@php.net | Date: | Thu, 03 Sep 2009 11:12:05 +0000 |
| Subject: | #49449 [Opn->Bgs]: Segmentation fault with ArrayObject::offsetSet() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-141906@lists.php.net to get a copy of this message | ||
ID: 49449
Updated by: mike@php.net
Reported By: arnold at adaniels dot nl
-Status: Open
+Status: Bogus
Bug Type: Reproducible crash
Operating System: Linux / Ubuntu 9.04
PHP Version: 5.3.0
New Comment:
You generate an infinite recursion.
Previous Comments:
------------------------------------------------------------------------
[2009-09-03 10:33:06] arnold at adaniels dot nl
Description:
------------
Using array access on $this in ArrayObject::offsetSet() causes a
segmentation fault.
(Calling parent::offsetSet() instead, works fine)
Reproduce code:
---------------
class AOTest extends ArrayObject
{
public function offsetSet($index, $newval)
{
$this[$index] = (int)$newval;
}
}
$a = new AOTest();
$a['test'] = "10 doves";
var_dump((array)$a);
Expected result:
----------------
array(1) {
["test"]=>
int(10)
}
Actual result:
--------------
Segmentation fault
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49449&edit=1