Embed QuickJS-ng in PHP to run JavaScript.
Pjs\Runtime— JS runtime environmentPjs\Context— evaluate JS code ($ctx->eval("1+1"))Pjs\Value— wraps JS return values, implementsStringablePjs\Exception— JS exceptions thrown as PHP exceptions
zig build testCustom PHP include path:
zig build test -Dphp-include-dir=/usr/include/php8.4PHPT tests are located in tests/. Run with:
php run-tests.php# Build
zig build
# Run JS evaluation
php -dextension=./modules/pjs.so -r '
$rt = new Pjs\Runtime();
$ctx = new Pjs\Context($rt);
var_dump($ctx->eval("1+1"));
'