xref: /PHP-7.3/Zend/tests/dynamic_call_005.phpt (revision 91f59403)
1--TEST--
2Dynamic calls to scope introspection functions are forbidden
3--FILE--
4<?php
5
6function test_calls($func) {
7    $i = 1;
8
9    array_map($func, [['i' => new stdClass]]);
10    var_dump($i);
11
12    $func(['i' => new stdClass]);
13    var_dump($i);
14
15    call_user_func($func, ['i' => new stdClass]);
16    var_dump($i);
17}
18test_calls('extract');
19
20?>
21--EXPECTF--
22Warning: Cannot call extract() dynamically in %s on line %d
23int(1)
24
25Warning: Cannot call extract() dynamically in %s on line %d
26int(1)
27
28Warning: Cannot call extract() dynamically in %s on line %d
29int(1)
30