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
728 B

<?php
declare(strict_types=1);
#[WasmExport(name: 'get-demo-report')]
function getDemoReport(string $argumentsJson, string $greeting, string $stdin): string
{
$arguments = json_decode($argumentsJson, true, flags: JSON_THROW_ON_ERROR);
$report = WasiDemo::report($arguments, $greeting, $stdin);
return json_encode(
$report,
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR,
);
}
#[WasmExport(name: 'get-extension-info')]
function getExtensionInfo(string $extension): string
{
return json_encode(
WasiDemo::extensionInfo($extension),
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR,
);
}