From:             soapergem at gmail dot com
Operating system: Windows XP
PHP version:      5.3.1
PHP Bug Type:     Class/Object related
Bug description:  method_exists doesn't work on "self"

Description:
------------
method_exists doesn't work if you pass in a callback with a reference to
"self". Yet call_user_func *does* work if you pass in a callback with a
reference to "self". This is inconsistent and probably not intentional.

Reproduce code:
---------------
<?php
class Test
{
    public static function check_method()
    {
        var_dump(method_exists('self', 'output'));
    }
    public static function run_method()
    {
        call_user_func(array('self', 'output'));
    }
    public static function output()
    {
        echo 'this works';
    }
}
Test::check_method();
Test::run_method();
?>

Expected result:
----------------
bool(true)
this works

Actual result:
--------------
bool(false)
this works

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

Reply via email to