ID:               42936
 Updated by:       [EMAIL PROTECTED]
 Reported By:      bacrhr at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: Windows XP
 PHP Version:      5.2.4
 New Comment:

The -> is for object access, but a static element belongs to the class.
use self::$pp instead. Using -> for static acces would just lead to
confusion.


Previous Comments:
------------------------------------------------------------------------

[2007-10-11 22:34:41] bacrhr at gmail dot com

Description:
------------
I could call and change static variable from object or from class

Reproduce code:
---------------
class A{
    public static $pp;
    public function ch(){
        $this->pp+=2;
        print $this->pp.'<br>';
    }
}
$b = new A();
$b->ch();
print $b->pp;


Expected result:
----------------
I expected error

Actual result:
--------------
output is:
2
2


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=42936&edit=1

Reply via email to