News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

EdFinkler's Blog:
Determining if a function is *really* available in PHP
March 29, 2007 @ 07:02:14

In this new post to his blog, Ed Finkler talks about some tests he worked up to discover if a function is available in PHP or not while working on the latest version of PHPSecInfo).

is_callable() will return TRUE even if a function has been disabled in php.ini with disabled_functions (which, in my mind, is contrary to what 'is_callable' implies). function_exists() will return FALSE if the function is disabled in php.ini, but will return TRUE if the function is being blocked by safe_mode.

So, to help counter these issues, he checks first to see if the exec('id') option works - checking it work function_exists and the setting for safe_mode (disabled). If it doesn't pass, he moves on to the posix_* function and tests then with a function_exists.

0 comments voice your opinion now!
function available exec posix iscallable functionexists function available exec posix iscallable functionexists


blog comments powered by Disqus

Similar Posts

WaxJelly Blog: How to write a custom Smarty function in PHP

SitePoint PHP Blog: Dynamic global functions in PHP

Scott Johnson\'s Blog: The Overhead of PHP is_ functions?

Stefan Mischook's Blog: Creating Custom PHP Functions Video Tutorial - Part 3

Matthew Weir O'Phinney's Blog: exuberant ctags with PHP in Vim


Community Events

Don't see your event here?
Let us know!


unittest series framework php7 api example library xdebug podcast install community release introduction laravel5 interview voicesoftheelephpant laravel language opinion extension

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework