php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68191 Broken reference across objects
Submitted: 2014-10-08 21:29 UTC Modified: -
From: miloslav dot hula at gmail dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: master-Git-2014-10-08 (Git) OS: Linux
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: miloslav dot hula at gmail dot com
New email:
PHP Version: OS:

 

 [2014-10-08 21:29 UTC] miloslav dot hula at gmail dot com
Description:
------------
I'm trying code on PHP commit 51c90e999fabda0cc10b82e0617e6e45797bf81d. With the latest I get SIGSEGV.

Following code works with PHP 5.0.0 - 5.6.1 (http://3v4l.org/Lc1QW). Workaround in method Bar::modify():

$this->prop = $this->prop . 'xxx';

Test script:
---------------
class Foo
{
    private $var;

    public function buggy()
    {
        $bar = new Bar;
        $bar->prop = & $this->var;
        $bar->modify();

        var_dump($this->var);
    }
}

class Bar
{
    public $prop;

    public function modify()
    {
        $this->prop .= 'xxx';
    }
}

$o = new Foo;
$o->buggy();


Expected result:
----------------
string(3) "xxx"

Actual result:
--------------
NULL

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-10-09 10:06 UTC] nikic@php.net
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e919caca86d78a25d4de10d2df2e1c4357ac4408
Log: Fix bug #68191: Broken reference across objects
 [2014-10-09 10:06 UTC] nikic@php.net
-Status: Open +Status: Closed
 [2014-10-10 20:59 UTC] ab@php.net
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e919caca86d78a25d4de10d2df2e1c4357ac4408
Log: Fix bug #68191: Broken reference across objects
 [2016-07-20 11:40 UTC] davey@php.net
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e919caca86d78a25d4de10d2df2e1c4357ac4408
Log: Fix bug #68191: Broken reference across objects
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 22:01:30 2025 UTC