]> granicus.if.org Git - php/commitdiff
- Fixed regression when calling func_get_args() from global scope
authorFelipe Pena <felipensp@gmail.com>
Sun, 11 Oct 2015 13:30:44 +0000 (10:30 -0300)
committerFelipe Pena <felipensp@gmail.com>
Sun, 11 Oct 2015 13:30:44 +0000 (10:30 -0300)
Zend/tests/func_get_args.phpt [new file with mode: 0644]
Zend/zend_builtin_functions.c

diff --git a/Zend/tests/func_get_args.phpt b/Zend/tests/func_get_args.phpt
new file mode 100644 (file)
index 0000000..eea8ae4
--- /dev/null
@@ -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
index 8ffdcaa0bc4548db041021e9c753b7c44a477573..347d1691800ca9d4b4203cf67d4c04f6d72114a0 100644 (file)
@@ -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;
        }