From:             andre-desch at t-online dot de
Operating system: Windows 7 Prof.
PHP version:      5.4.4
Package:          Reflection related
Bug Type:         Bug
Bug description:__callStatic from a derived class object context calls __call 
instead

Description:
------------
If You define both the magic function for static and dynamic calls for a
class and 
then call a static function from a derivate's method, not the static but
the 
dynamic magic function is called.

Test script:
---------------
<?php

class MyBaseClass {

        public static function __callStatic($what, $args)
        {
                return 'static call';
        }
        
        public function __call($what, $args)
        {
                return 'dynamic call';
        }

}

class MyDerivedClass extends MyBaseClass {

        function someAction()
        {
                //here I call a base class' static function
                //it returns "dynamic call" instead of "static call"
                return MyBaseClass::Foo();
        }

}

$bar = new MyDerivedClass();
echo $bar->someAction();

?>

Expected result:
----------------
static call

Actual result:
--------------
dynamic call

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

Reply via email to