PHP source
Output
Waiting for the runtime to boot…
Bundle the real engine (switch the Package API preset to real execution)
The Package API preset guards its real-engine path behind
is_file('/preload/vendor/autoload.php'). This hosted demo ships no
vendor/, so it prints an explanatory message and the PHP version instead of
fatally requiring a missing file. To run the real engine, mount the package's
vendor/ into the WASM filesystem at /preload/vendor:
// 1. Install the package somewhere and collect its autoloadable vendor/ tree:
composer require hmennen90/laravel-graphql
// 2. Serve vendor/ as static assets, then mount it into the WASM FS before running.
// (php-wasm 0.0.9-alpha-32, single-threaded PhpWeb build)
import { PhpWeb } from 'https://cdn.jsdelivr.net/npm/php-wasm@0.0.9-alpha-32/PhpWeb.mjs';
const php = new PhpWeb();
await new Promise(r => php.addEventListener('ready', r, { once: true }));
// Write each vendor file into the in-memory FS under /preload/vendor, e.g.:
// php.FS.mkdirTree('/preload/vendor');
// php.FS.writeFile('/preload/vendor/autoload.php', await (await fetch('vendor/autoload.php')).text());
// A build step typically walks vendor/ and emits these writes, or mounts a
// packed image. Once /preload/vendor/autoload.php exists, the Package API preset
// takes its real branch automatically — no code change needed.
Because it is the identical framework-agnostic engine used in the benchmarks, a real query then returns exactly what a server would — only slower, because it is WASM.