note 51083 added to function.is-callable

From: Date: Fri, 18 Mar 2005 23:39:13 +0000
Subject: note 51083 added to function.is-callable
Groups: php.notes 
Request: Send a blank email to php-notes+get-86671@lists.php.net to get a copy of this message
I've been spending a month on and off trying to figure out why is_callable($object, [true or false], $varContainingFunctionName) returned false when it should not have (ie: $object->FunctionName() was callable), I realized I must have misunderstood its purpose. If you find yourself in the same situation, try function_exists(string functionname) or method_exists ( object object, string method_name ) before you rip your hair out :) ---- Manual Page -- http://www.php.net/manual/en/function.is-callable.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51083 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51083&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51083&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51083&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51083&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51083&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51083&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#86671) next »