note 67947 modified in function.function-exists by danbrown

From: Date: Sat, 19 Jul 2008 20:44:21 +0000
Subject: note 67947 modified in function.function-exists by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-141726@lists.php.net to get a copy of this message
function_exists will return false for functions disabled with the disable_functions ini directive. However those functions are still declared so trying to define them yourself will fail. <?php if(!function_exists('readfile')){ function readfile($file){ $handle=@fopen($cache,"r"); echo @fread($handle,filesize($file)); @fclose($handle); } } ?> The above will issue a "Cannot redeclare readfile()" fatal error if readfile was disabled with disable_functions. --was-- function_exists will return false for functions disabled with the disable_functions ini directive. However those functions are still declared so trying to define them yourself will fail. <? if(!function_exists('readfile')){ function readfile($file){ $handle=@fopen($cache,"r"); echo @fread($handle,filesize($file)); @fclose($handle); } } ?> The above will issue a "Cannot redeclare readfile()" fatal error if readfile was disabled with disable_functions. http://php.net/manual/en/function.function-exists.php

« previous php.notes (#141726) next »