|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-11-25 07:52 UTC] jani@php.net
[2016-01-15 13:53 UTC] danack@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 09:00:01 2025 UTC |
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