xref: /PHP-7.1/Zend/tests/dynamic_call_006.phpt (revision 91f59403)
1--TEST--
2Dynamic calls to scope introspection functions are forbidden (function variations)
3--FILE--
4<?php
5function test() {
6    $func = 'extract';
7    $func(['a' => 'b']);
8
9    $func = 'compact';
10    $func(['a']);
11
12    $func = 'parse_str';
13    $func('a=b');
14
15    $func = 'get_defined_vars';
16    $func();
17
18    $func = 'assert';
19    $func('1==2');
20
21    $func = 'func_get_args';
22    $func();
23
24    $func = 'func_get_arg';
25    $func(1);
26
27    $func = 'func_num_args';
28    $func();
29}
30test();
31
32?>
33--EXPECTF--
34Warning: Cannot call extract() dynamically in %s on line %d
35
36Warning: Cannot call compact() dynamically in %s on line %d
37
38Warning: Cannot call parse_str() with a single argument dynamically in %s on line %d
39
40Warning: Cannot call get_defined_vars() dynamically in %s on line %d
41
42Warning: Cannot call assert() with string argument dynamically in %s on line %d
43
44Warning: Cannot call func_get_args() dynamically in %s on line %d
45
46Warning: Cannot call func_get_arg() dynamically in %s on line %d
47
48Warning: Cannot call func_num_args() dynamically in %s on line %d
49