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
548 B
23 lines
548 B
--TEST--
|
|
WASI filesystem supports PHP stream read, write and directory operations
|
|
--FILE--
|
|
<?php
|
|
function main(): void
|
|
{
|
|
$directory = '/sandbox/typephp';
|
|
$file = $directory . '/message.txt';
|
|
if (!is_dir($directory)) {
|
|
mkdir($directory);
|
|
}
|
|
file_put_contents($file, "hello filesystem\n");
|
|
echo file_get_contents($file);
|
|
var_dump(in_array('message.txt', scandir($directory), true));
|
|
unlink($file);
|
|
rmdir($directory);
|
|
var_dump(file_exists($file));
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
hello filesystem
|
|
bool(true)
|
|
bool(false)
|
|
|