PHP :: Bug #26182 :: Object properties created redundantly
| Bug #26182 | Object properties created redundantly | ||||
|---|---|---|---|---|---|
| Submitted: | 2003-11-08 19:47 UTC | Modified: | 2003-12-16 03:01 UTC | ||
| From: | hongnk at hotmail dot com | Assigned: | andi (profile) | ||
| Status: | Closed | Package: | Scripting Engine problem | ||
| PHP Version: | 5CVS | OS: | * | ||
| Private report: | No | CVE-ID: | None | ||
[2003-11-08 19:47 UTC] 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 }
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2003-11-25 04:20 UTC] sniper@php.net
[2003-11-27 12:05 UTC] helly@php.net
[2003-11-27 12:06 UTC] helly@php.net
[2003-12-01 07:10 UTC] sniper@php.net
[2003-12-16 03:01 UTC] sniper@php.net