#43335 [Opn->Bgs]: Unset $this inside a method
| From: | jani@php.net | Date: | Mon, 19 Nov 2007 13:16:02 +0000 |
| Subject: | #43335 [Opn->Bgs]: Unset $this inside a method | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-119822@lists.php.net to get a copy of this message | ||
ID: 43335
Updated by: jani@php.net
Reported By: felipensp at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
PHP Version: 5.3CVS-2007-11-19 (snap)
New Comment:
It means it doesn't have any effect except inside that method..
And this isn't any different from how it works in 5.2 -> bogus.
Previous Comments:
------------------------------------------------------------------------
[2007-11-19 12:29:21] felipensp at gmail dot com
Description:
------------
Manual says:
"Note: It is not possible to unset $this inside an object method since
PHP 5."
Reproduce code:
---------------
<?php
class foo {
public function __construct() {
unset($this);
var_dump($this);
}
}
new foo;
Expected result:
----------------
object(foo)#1 (0) {
}
Actual result:
--------------
NULL
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43335&edit=1