note 73292 added to function.function-exists

From: Date: Fri, 16 Feb 2007 11:09:30 +0000
Subject: note 73292 added to function.function-exists
Groups: php.notes 
Request: Send a blank email to php-notes+get-123481@lists.php.net to get a copy of this message
to brooklynphil at hotmail dot com: Your post is misleading, namely the 3rd and last speedtest you describe is an unfair comparison: <?php is_callable('test','test'); ?> The value of the 2nd parameter $syntax_only is 'test' and this evaluates to boolean true. In other words, this is exactly the same as calling the function like this: <?php is_callable('test',true); ?> Of course this will be faster because is_callable only does a very basic syntaxcheck. From the documentation: 'It will only reject simple variables that are not strings, or an array that does not have a valid structure to be used as a callback.' If you omit this erroneous 3rd test, then according to your examples function_exists is 2 to 4 times faster. I hope you can see that loop-testing functions is not so simple. :) rtfm ---- Server IP: 87.238.162.147 Probable Submitter: 193.58.129.246 ---- Manual Page -- http://www.php.net/manual/en/function.function-exists.php Edit -- https://master.php.net/note/edit/73292 Del: integrated -- https://master.php.net/note/delete/73292/integrated Del: useless -- https://master.php.net/note/delete/73292/useless Del: bad code -- https://master.php.net/note/delete/73292/bad+code Del: spam -- https://master.php.net/note/delete/73292/spam Del: non-english -- https://master.php.net/note/delete/73292/non-english Del: in docs -- https://master.php.net/note/delete/73292/in+docs Del: other reasons-- https://master.php.net/note/delete/73292 Reject -- https://master.php.net/note/reject/73292 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#123481) next »