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.
23 lines
499 B
23 lines
499 B
<?php
|
|
/**
|
|
* This file is part of TypePHP(AOT).
|
|
*
|
|
* @link https://www.swoole.com/aot/
|
|
* @contact service@swoole.com
|
|
*/
|
|
|
|
function local_native_closure_codegen(): void
|
|
{
|
|
$base = 1;
|
|
$direct = static fn (int $value): int => $base + $value;
|
|
var_dump($direct(2));
|
|
|
|
$escaped = static fn (int $value): int => $value + 1;
|
|
array_map($escaped, [1]);
|
|
|
|
$dynamic = std::any(1);
|
|
$dynamicRef = function () use (&$dynamic): void {
|
|
$dynamic++;
|
|
};
|
|
$dynamicRef();
|
|
}
|
|
|