php-src/Zend/tests/028.phpt
Nikita Popov c48b745f00 Promote "undefined array key" notice to warning
This implements the last remaining part of the
https://wiki.php.net/rfc/engine_warnings RFC.

Closes GH-5927.
2020-08-03 14:40:50 +02: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