From:             magike dot net at gmail dot com
Operating system: Ubuntu Server 12.04
PHP version:      5.3.14
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:PHP confuse "__callStatic" with "__call"

Description:
------------
I find PHP will call "__call" instead of "__callStatic" when I'm calling a
non-
exists static method from the class (Class A) which is the parent of
current class 
(Class B).

And if the class (Class C) is not the child of that class (Class A), the
result 
will be correct.



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

class A
{
    public function __call($name, $args)
    {
        echo "NO\n";
    }

    public static function __callStatic($name, $args)
    {
        echo "YES\n";
    }
}

class B extends A
{
    public function test()
    {
        A::test();
    }
}

class C
{
    public function test()
    {
        A::test();
    }
}

A::test();

$b = new B();
$b->test();

$c = new C();
$c->text();

Expected result:
----------------
YES
YES
YES

Actual result:
--------------
YES
NO
YES

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

Reply via email to