mirror of
https://github.com/php/php-src.git
synced 2026-04-20 14:31:06 +02:00
Per RFC: https://wiki.php.net/rfc/arrow_functions_v2 Co-authored-by: Levi Morrison <levim@php.net> Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
15 lines
376 B
PHP
15 lines
376 B
PHP
--TEST--
|
|
Pretty printing for arrow functions
|
|
--FILE--
|
|
<?php
|
|
|
|
// TODO We're missing parentheses for the direct call
|
|
assert((fn() => false)());
|
|
assert((fn&(int... $args): ?bool => $args[0])(false));
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Warning: assert(): assert(fn() => false()) failed in %s on line %d
|
|
|
|
Warning: assert(): assert(fn&(int ...$args): ?bool => $args[0](false)) failed in %s on line %d
|