1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 14:31:06 +02:00
Files
archived-php-src/Zend/tests/arrow_functions/007.phpt
Nikita Popov f3e5bbe6f3 Implement arrow functions
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>
2019-05-02 15:04:03 +02:00

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