xref: /PHP-8.3/Zend/tests/arrow_functions/007.phpt (revision 3d4ff5ae)
1--TEST--
2Pretty printing for arrow functions
3--INI--
4zend.assertions=1
5--FILE--
6<?php
7
8// TODO We're missing parentheses for the direct call
9
10try {
11    assert((fn() => false)());
12} catch (AssertionError $e) {
13    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
14}
15
16try {
17    assert((fn&(int... $args): ?bool => $args[0])(false));
18} catch (AssertionError $e) {
19    echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
20}
21
22?>
23--EXPECT--
24assert(): assert(fn() => false()) failed
25assert(): assert(fn&(int ...$args): ?bool => $args[0](false)) failed
26