1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/function_call_array_item.phpt
Alexandre Daubois e43074a1d8 Rename poorly named tests in Zend/tests (#19332)
And move some into their relevant folders
2025-07-31 19:58:01 +01:00

27 lines
489 B
PHP

--TEST--
Testing function call through of array item
--FILE--
<?php
$arr = array('strtoupper', 'strtolower');
$k = 0;
var_dump($arr[0]('foo') == 'FOO');
var_dump($arr[$k]('foo') == 'FOO');
var_dump($arr[++$k]('FOO') == 'foo');
var_dump($arr[++$k]('FOO') == 'foo');
?>
--EXPECTF--
bool(true)
bool(true)
bool(true)
Warning: Undefined array key 2 in %s on line %d
Fatal error: Uncaught Error: Value of type null is not callable in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d