xref: /PHP-7.3/Zend/tests/028.phpt (revision e97d5fab)
1--TEST--
2Testing function call through of array item
3--FILE--
4<?php
5
6$arr = array('strtoupper', 'strtolower');
7
8$k = 0;
9
10var_dump($arr[0]('foo') == 'FOO');
11var_dump($arr[$k]('foo') == 'FOO');
12var_dump($arr[++$k]('FOO') == 'foo');
13var_dump($arr[++$k]('FOO') == 'foo');
14
15?>
16--EXPECTF--
17bool(true)
18bool(true)
19bool(true)
20
21Notice: Undefined offset: 2 in %s on line %d
22
23Fatal error: Uncaught Error: Function name must be a string in %s:%d
24Stack trace:
25#0 {main}
26  thrown in %s on line %d
27