[PHP-BUG] Bug #51524 [NEW]: Class static method confusion

[email protected] ("david71rj at gmail dot com") Sat, 10 Apr 2010 03:37:23 +0200 (CEST)
Newsgroups php.bugs
Message-ID <[email protected]>
From:             
Operating system: Windows 7/64
PHP version:      5.3.2
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:Class static method confusion

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 bug report at http://bugs.php.net/bug.php?id=51524&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=51524&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=51524&r=trysnapshot53
Try a snapshot (PHP 6.0):            http://bugs.php.net/fix.php?id=51524&r=trysnapshot60
Fixed in SVN:                        http://bugs.php.net/fix.php?id=51524&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51524&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=51524&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=51524&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=51524&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=51524&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=51524&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=51524&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=51524&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=51524&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=51524&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51524&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51524&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=51524&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=51524&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=51524&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=51524&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=51524&r=mysqlcfg