1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 18:23:26 +02:00
Files
archived-php-src/Zend/tests/arrow_functions/007.phpt
T

26 lines
556 B
PHP

--TEST--
Pretty printing for arrow functions
--INI--
zend.assertions=1
--FILE--
<?php
// TODO We're missing parentheses for the direct call
try {
assert((fn() => false)());
} catch (AssertionError $e) {
echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
}
try {
assert((fn&(int... $args): ?bool => $args[0])(false));
} catch (AssertionError $e) {
echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
}
?>
--EXPECT--
assert(): assert(fn() => false()) failed
assert(): assert(fn&(int ...$args): ?bool => $args[0](false)) failed