Bug #70179 [Opn->Csd]: $this refcount issue
| From: | bwoebi@php.net | Date: | Sat, 01 Aug 2015 18:36:04 +0000 |
| Subject: | Bug #70179 [Opn->Csd]: $this refcount issue | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-194880@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70179&edit=1
ID: 70179
Updated by: bwoebi@php.net
Reported by: marcio dot web2 at gmail dot com
Summary: $this refcount issue
-Status: Open
+Status: Closed
Type: Bug
Package: Scripting Engine problem
PHP Version: 7.0.0beta2
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2d6f0e4584375c90a895fed4074d579f364aa347
Log: Fix bug #70179 ($this refcount issue)
Previous Comments:
------------------------------------------------------------------------
[2015-07-31 22:49:35] marcio dot web2 at gmail dot com
commits worth inspecting :)
https://github.com/php/php-src/commit/ab4ccffc4cceb877d2ce3144e5c499bd651886bf
https://github.com/php/php-src/commit/bdbe121098dc6d656e6ec38aaef27001df5e4611
------------------------------------------------------------------------
[2015-07-31 21:32:52] marcio dot web2 at gmail dot com
Description:
------------
This is probably related to refcount of $this that happens only when the object is invoked as a
closure:
http://3v4l.org/7PZip
When there is an assignment the same problem does not occurs:
http://3v4l.org/deLUQ
Test script:
---------------
<?php
class X {
function __invoke() {
var_dump($this);
}
}
(new X)();
Expected result:
----------------
object(X)#1 (0) {
}
Actual result:
--------------
*RECURSION*
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70179&edit=1