From: Felipe Pena Date: Sun, 11 Oct 2015 13:30:44 +0000 (-0300) Subject: - Fixed regression when calling func_get_args() from global scope X-Git-Tag: php-7.1.0alpha1~983 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=acbecd7b31b3b05dd14c11dbe5b856c7522664b3;p=php - Fixed regression when calling func_get_args() from global scope --- diff --git a/Zend/tests/func_get_args.phpt b/Zend/tests/func_get_args.phpt new file mode 100644 index 0000000000..eea8ae4354 --- /dev/null +++ b/Zend/tests/func_get_args.phpt @@ -0,0 +1,10 @@ +--TEST-- +Testing func_get_args() +--FILE-- + +--EXPECTF-- +Warning: func_get_args(): Called from the global scope - no function context in %s on line 3 diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 8ffdcaa0bc..347d169180 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -487,7 +487,7 @@ ZEND_FUNCTION(func_get_args) uint32_t i, n; zend_execute_data *ex = EX(prev_execute_data); - if (ZEND_CALL_INFO(ex) & ZEND_CALL_CODE) { + if (!ex || ZEND_CALL_INFO(ex) & ZEND_CALL_CODE) { zend_error(E_WARNING, "func_get_args(): Called from the global scope - no function context"); RETURN_FALSE; }