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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sat Sep 20 11:00:01 2025 UTC