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

 ID:               51524
 Updated by:       johan...@php.net
 Reported by:      david71rj at gmail dot com
 Summary:          Class static method confusion
-Status:           Open
+Status:           Bogus
 Type:             Bug
 Package:          Scripting Engine problem
 Operating System: Windows 7/64
 PHP Version:      5.3.2

 New Comment:

If a static method is called from an object context the callers $this is
sent. This i due to compatibility with the way PHP 4 worked.


Previous Comments:
------------------------------------------------------------------------
[2010-04-10 03:37:23] david71rj at gmail dot com

Description:
------------
If I use public method as static in a method of a second function, this
send $this 

from second class, don't of the first.

Test script:
---------------
http://codepad.org/8hW4Qtbo

Expected result:
----------------
array

  0 => string 'static' (length=6)

  1 => int 1

array

  0 => string 'object' (length=6)

  1 => 

    object(test)[2]

  2 => int 1

array

  0 => string 'static' (length=6)

  1 => int 1

array

  0 => string 'object' (length=6)

  1 => 

    object(test)[3] <<<<<<<<<<<<<<< OKAY

  2 => int 1

Actual result:
--------------
array

  0 => string 'static' (length=6)

  1 => int 1

array

  0 => string 'object' (length=6)

  1 => 

    object(test)[2]

  2 => int 1

array

  0 => string 'static' (length=6)

  1 => int 1

array

  0 => string 'object' (length=6)

  1 => 

    object(test2)[3] <<<<<<<<< WHY "test2" IF DON'T?

  2 => int 1


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



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

Reply via email to