Reputation: 891
I were not able to find a proper source stating what the intended behaviour is when invoking a function listed in disable_functions
.
My observation is that a log entry is created saying something like
[04-Sep-2014 16:17:55 UTC] PHP Warning: curl_exec() has been disabled for security reasons in {file} {line}
But what does the function return in such a case? And I mean what is it documented to return?
Upvotes: 0
Views: 64
Reputation:
This functionality is not formally documented, but if you look at the source, PHP has a placeholder function that gets called instead of a disabled function. This placeholder function only generates the warning and does not explicitly return any value. This "lack of a return value" is translated to a NULL
before your PHP code sees it.
Upvotes: 1
Reputation: 79014
I haven't seen it documented, but it returns NULL
. With disable_functions = file_get_contents
:
var_dump(file_get_contents(__FILE__));
Warning: file_get_contents() has been disabled for security reasons in test.php on line 2
NULL
Same results with curl_exec
.
Upvotes: 0