com php-src: - Fixed regression when calling func_get_args () from global scope: Zend/tests/func_get_arg s.phpt Zend/zend_builtin_functions.c
| From: | Felipe Pena | Date: | Sun, 11 Oct 2015 13:30:44 +0000 |
| Subject: | com php-src: - Fixed regression when calling func_get_args () from global scope: Zend/tests/func_get_arg s.phpt Zend/zend_builtin_functions.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89364@lists.php.net to get a copy of this message | ||
Commit: acbecd7b31b3b05dd14c11dbe5b856c7522664b3
Author: Felipe Pena <felipensp@gmail.com> Sun, 11 Oct 2015 10:30:44 -0300
Parents: 9f27624641931f2035a2798d6660e8a4a931556f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=acbecd7b31b3b05dd14c11dbe5b856c7522664b3
Log:
- Fixed regression when calling func_get_args() from global scope
Changed paths:
A Zend/tests/func_get_args.phpt
M Zend/zend_builtin_functions.c
Diff:
diff --git a/Zend/tests/func_get_args.phpt b/Zend/tests/func_get_args.phpt
new file mode 100644
index 0000000..eea8ae43
--- /dev/null
+++ b/Zend/tests/func_get_args.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Testing func_get_args()
+--FILE--
+<?php
+
+func_get_args();
+
+?>
+--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 8ffdcaa..347d169 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;
}