TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
308 B

--TEST--
arrow function
--FILE--
<?php
function foo($obj) {
$fn = fn (string $add) => $obj->add(new DateInterval($add));
$newDate = $fn('P10D');
echo $newDate->format('Y-m-d') . "\n";
}
function main()
{
$date = new DateTimeImmutable('2000-01-01');
foo($date);
}
?>
--EXPECT--
2000-01-11