ID:               50289
 Updated by:       [email protected]
 Reported By:      soapergem at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: Windows XP
 PHP Version:      5.3.1
 New Comment:

callback != object or class name

There is no bug here.


Previous Comments:
------------------------------------------------------------------------

[2009-11-24 21:37:28] soapergem at gmail dot com

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 this bug report at http://bugs.php.net/?id=50289&edit=1

Reply via email to