|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-09-22 09:17 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: nikic
[2012-09-22 09:17 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 04:00:02 2025 UTC |
You support calling user methods using an array in the call_user_func() function. But related functions of call_user_func() don't support the syntax. I would like to see that function_exists could check if the user method exists. The following example code should work: class Foo { function bar($what = 'world') { print 'Hello ' . $what; } } $a_foo = new Foo(); $user_method = array($a_foo, 'bar'); if (!function_exists($user_method)) die('You shouldn\'t see this :)'); $user_method('PHP'); // Should print "Hello PHP" ofcourse. Furthermore the implementation of the user_method calling in call_user_func is incorrect for referencing variabeles, which might be pretty usefull. (see http://bugs.php.net/bug.php?id=17309)