Bug #74635 [Com]: when call a disabled function,php not throw a fatal error
| From: | spam2 at rhsoft dot net | Date: | Tue, 23 May 2017 08:07:58 +0000 |
| Subject: | Bug #74635 [Com]: when call a disabled function,php not throw a fatal error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-209231@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74635&edit=1
ID: 74635
Comment by: spam2 at rhsoft dot net
Reported by: shengbin_xu at 163 dot com
Summary: when call a disabled function,php not throw a fatal
error
Status: Duplicate
Type: Bug
Package: Scripting Engine problem
Operating System: ubuntu
PHP Version: 7.1.5
Block user comment: N
Private report: N
New Comment:
And this is pretty serious since the following code runs with completely undefined behavior - i
reported that months ago and it was argued that the disabled functions are still listed in defined
functions
in a normal code flow I don't give a damn if a function don't exist at all, is disabled or
the extension is not loaded when I just can't call it
Since php7 is throwing exceptions everywhere but here and in the soap extension both are just plain
bugs and a horrible inconsistency
Previous Comments:
------------------------------------------------------------------------
[2017-05-23 07:04:12] requinix@php.net
See bug #73921
------------------------------------------------------------------------
[2017-05-23 05:03:33] shengbin_xu at 163 dot com
Description:
------------
in php.ini,popen function is in disable functions:
disable_functions => passthru,system,popen,chroot,escapeshellcmd,proc_get_status =>
passthru,system,popen,chroot,escapeshellcmd,proc_get_status
function_exists('popen') return false,but when call popen, php only give a notice,but not
throw a fatal errorã
Test script:
---------------
<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
var_dump(function_exists('popen'));//false
$handle = popen("/bin/ls", "r");//null Warning: popen() has been disabled for
security reasons in
var_dump($handle);
echo gettype($handle);
Expected result:
----------------
when popen function is called,php should throw a fatal errorã
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74635&edit=1