Bug #68191 [Opn->Csd]: Broken reference across objects

From: Date: Thu, 09 Oct 2014 10:06:18 +0000
Subject: Bug #68191 [Opn->Csd]: Broken reference across objects
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187980@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68191&edit=1 ID: 68191 Updated by: nikic@php.net Reported by: miloslav dot hula at gmail dot com Summary: Broken reference across objects -Status: Open +Status: Closed Type: Bug Package: Scripting Engine problem Operating System: Linux PHP Version: master-Git-2014-10-08 (Git) Block user comment: N Private report: N New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2014-10-08 21:29:31] 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68191&edit=1

« previous php.bugs (#187980) next »