Bug #70179 [Opn]: $this refcount issue
| From: | marcio dot web2 at gmail dot com | Date: | Fri, 31 Jul 2015 22:49:36 +0000 |
| Subject: | Bug #70179 [Opn]: $this refcount issue | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-194870@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
User updated by: marcio dot web2 at gmail dot com
Reported by: marcio dot web2 at gmail dot com
Summary: $this refcount issue
Status: Open
Type: Bug
Package: Scripting Engine problem
PHP Version: 7.0.0beta2
Block user comment: N
Private report: N
New Comment:
commits worth inspecting :)
https://github.com/php/php-src/commit/ab4ccffc4cceb877d2ce3144e5c499bd651886bf
https://github.com/php/php-src/commit/bdbe121098dc6d656e6ec38aaef27001df5e4611
Previous Comments:
------------------------------------------------------------------------
[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