Add embed sanity check

This commit is contained in:
crazywhalecc
2024-12-10 23:08:01 +08:00
committed by Jerry Ma
parent f433866671
commit c4b9660cd7
6 changed files with 61 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
#include <sapi/embed/php_embed.h>
int main(int argc,char **argv){
PHP_EMBED_START_BLOCK(argc,argv)
zend_file_handle file_handle;
zend_stream_init_filename(&file_handle,"embed.php");
if(php_execute_script(&file_handle) == FAILURE){
php_printf("Failed to execute PHP script.\n");
}
PHP_EMBED_END_BLOCK()
return 0;
}

View File

@@ -0,0 +1,4 @@
<?php
declare(strict_types=1);
echo 'hello' . PHP_EOL;