function_exists question
| From: | Matt Pagel | Date: | Fri, 16 Jan 2009 20:21:53 +0000 |
| Subject: | function_exists question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-286523@lists.php.net to get a copy of this message | ||
Is there a way to check not only if a function exists, but also to check that the number and types of parameters desired match a function definition?
The reason being that additional options have been added in php 4 and 5 to various standard function calls, but I'm still running a php3 and php4 server in addition to a php5 server. I would like to make sure that certain "extended" function calls still work in all versions (or I'll perform the tasks "manually", albeit less efficiently).
One example I can think of is the round() function. The $precision parameter was added in php4, so will not work in php3. However, function_exists would return TRUE for both 3 and 4, but round itself would fail if I tried to send a precision level to the php3 server.
Thanks much,
Matt
P.S. Of course the modified "function_exists" would unfortunately have to be a recognized function/method in php3 in order for me to call it to check parameter counts on a php3 server :(