ID:               42595
 Updated by:       [EMAIL PROTECTED]
 Reported By:      agideonse at planet dot nl
-Status:           Open
+Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: Irrelevant
 PHP Version:      5.2.4
 New Comment:

See bug #42559


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

[2007-09-08 02:02:46] agideonse at planet dot nl

Description:
------------
When a function in a class is not declared static it can still be
called as a static method (no problem). When this is done from another
class the function seems to know the values from the class that it was
called from. It is not clarified in the manual why this should be the
case ($this is bound to class A, not class B) if this isn't a bug.

Reproduce code:
---------------
class A
{
   function __construct()
   {
      $this->name = "Class A";
   }

   function doeIets()
   {
      B::doeIetsAnders();
   }
}

class B
{
   function doeIetsAnders()
   {
      print_r($this);
   }
} 

Expected result:
----------------
In strict mode, there should be a warning that $this does not have a
value.

Actual result:
--------------
$this has te values of class A. 


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


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

Reply via email to