|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-01-07 20:53 UTC] levim@php.net
-Package: Feature/Change Request
+Package: *General Issues
[2015-01-07 20:53 UTC] levim@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 13:00:01 2025 UTC |
Description: ------------ It would be useful to be able to use the is_callable() function on an object that overloads with __call(). Perhaps something like a magic __callable() or __is_callable() method that would return true or false on whether or not the method is callable. Reproduce code: --------------- <?php class MyClass { public function __callable( $sMethod ) { return( is_callable( array( $this, $sMethod ) ) ); } private function MyFunction() {} } $oMyClass = new MyClass(); if( is_callable( $oMyClass, "MyFunction" ) ) { echo "Callable!"; } ?> Expected result: ---------------- Callable! Actual result: -------------- [no output]