php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68196 Segfault when by-ref assigning offset of overloaded object
Submitted: 2014-10-09 10:09 UTC Modified: 2016-03-20 12:43 UTC
From: nikic@php.net Assigned: nikic (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.4Git-2014-10-09 (Git) OS:
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: nikic@php.net
New email:
PHP Version: OS:

 

 [2014-10-09 10:09 UTC] nikic@php.net
Description:
------------
Not actually sure which parts of this are actually supposed to work (as we didn't previously support by-ref modification for ArrayAccess).

Test script:
---------------
<?php error_reporting(E_ALL);

class RefArray implements ArrayAccess {
    public $array;
    public function &offsetGet($key) { return $this->array[$key]; }
    public function offsetSet($key, $value) { $this->array[$key] = $value; }
    public function offsetExists($key) { return isset($this->array[$key]); }
    public function offsetUnset($key) { unset($this->array[$key]); }
}

$arr = new RefArray;
$arr[0] = 'abc';
$arr[1] =& $arr[0];


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-20 12:43 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2016-03-20 12:43 UTC] nikic@php.net
Doesn't exist anymore, and 3v4l doesn't show it ever existing: https://3v4l.org/ggHJm

So either I was hallucinating here or it was fixed before the first 5.4 release. Closing either way.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 06:01:35 2024 UTC