#26182 [Opn->Ver]: Object properties created redundantly
| From: | sniper@php.net | Date: | Tue, 25 Nov 2003 09:20:12 +0000 |
| Subject: | #26182 [Opn->Ver]: Object properties created redundantly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-50966@lists.php.net to get a copy of this message | ||
ID: 26182
Updated by: sniper@php.net
Reported By: hongnk at hotmail dot com
-Status: Open
+Status: Verified
Bug Type: Zend Engine 2 problem
Operating System: Win2k
-PHP Version: 5.0.0b2 (beta2)
+PHP Version: 5CVS
New Comment:
Works as expected with PHP 4, fails with PHP 5.
Previous Comments:
------------------------------------------------------------------------
[2003-11-08 19:47:47] hongnk at hotmail dot com
Description:
------------
Whenever a variable is refered anywhere inside a class under the form
$this->varname, it is automatically created in class instances.
Reproduce code:
---------------
class A {
function NotAConstructor(){
if(isset($this->x)){
//just for demo
}
}
}
$t=new A();
var_dump($t);
Expected result:
----------------
object(a)#1 (0) { }
Actual result:
--------------
object(a)#1 (1) { ["x"]=> NULL }
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26182&edit=1