php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49451 Segmentation fault with ArrayObject::offsetSet()
Submitted: 2009-09-03 10:34 UTC Modified: 2009-09-03 10:42 UTC
From: info at adaniels dot nl Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.3.0 OS: Linux / Ubuntu 9.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: info at adaniels dot nl
New email:
PHP Version: OS:

 

 [2009-09-03 10:34 UTC] info 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-03 10:42 UTC] derick@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

49449
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 08 16:01:33 2024 UTC