{"id":13510610,"url":"https://github.com/wasmerio/wasmer-php","last_synced_at":"2025-06-25T14:05:12.974Z","repository":{"id":46094066,"uuid":"157876278","full_name":"wasmerio/wasmer-php","owner":"wasmerio","description":"🐘🕸️ WebAssembly runtime for PHP","archived":false,"fork":false,"pushed_at":"2024-02-27T08:32:43.000Z","size":25644,"stargazers_count":1041,"open_issues_count":18,"forks_count":43,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-06-22T06:15:24.772Z","etag":null,"topics":["php","php-extension","rust","wasm","wasmer","webassembly"],"latest_commit_sha":null,"homepage":"https://wasmerio.github.io/wasmer-php/wasm/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wasmerio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-11-16T14:11:42.000Z","updated_at":"2025-06-06T17:28:28.000Z","dependencies_parsed_at":"2024-04-16T23:51:45.884Z","dependency_job_id":null,"html_url":"https://github.com/wasmerio/wasmer-php","commit_stats":{"total_commits":389,"total_committers":8,"mean_commits":48.625,"dds":"0.16966580976863754","last_synced_commit":"d592186dfff0c980314f6dac62f6e26b51478fb1"},"previous_names":["wasmerio/php-ext-wasm"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/wasmerio/wasmer-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasmerio%2Fwasmer-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasmerio%2Fwasmer-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasmerio%2Fwasmer-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasmerio%2Fwasmer-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wasmerio","download_url":"https://codeload.github.com/wasmerio/wasmer-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasmerio%2Fwasmer-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261888088,"owners_count":23225138,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","php-extension","rust","wasm","wasmer","webassembly"],"created_at":"2024-08-01T02:01:46.746Z","updated_at":"2025-06-25T14:05:12.942Z","avatar_url":"https://github.com/wasmerio.png","language":"PHP","funding_links":[],"categories":["PHP","webassembly"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://wasmer.io\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n    \u003cimg width=\"300\" src=\"https://raw.githubusercontent.com/wasmerio/wasmer/master/assets/logo.png\" alt=\"Wasmer logo\"\u003e\n  \u003c/a\u003e\n  \n  \u003ch1\u003eWasmer PHP\u003c/h1\u003e\n  \n  \u003cp\u003e\n    \u003ca href=\"https://github.com/wasmerio/wasmer-php/actions?query=workflow%3A%22Tests%22\"\u003e\n      \u003cimg src=\"https://github.com/wasmerio/wasmer-php/workflows/Tests/badge.svg\" alt=\"Tests Status\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/wasmerio/wasmer-php/actions?query=workflow%3A%22Nightly%22\"\u003e\n      \u003cimg src=\"https://github.com/wasmerio/wasmer-php/workflows/Nightly/badge.svg\" alt=\"Nightly Status\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/wasmerio/wasmer-php/blob/master/LICENSE\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/license/wasmerio/wasmer-php.svg\" alt=\"License\"\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\n  \u003ch3\u003e\n    \u003ca href=\"https://wasmer.io/\"\u003eWebsite\u003c/a\u003e\n    \u003cspan\u003e • \u003c/span\u003e\n    \u003ca href=\"https://docs.wasmer.io\"\u003eDocs\u003c/a\u003e\n    \u003cspan\u003e • \u003c/span\u003e\n    \u003ca href=\"https://slack.wasmer.io/\"\u003eSlack Channel\u003c/a\u003e\n  \u003c/h3\u003e\n\n\u003c/div\u003e\n\n\u003chr/\u003e\n\nA complete and mature WebAssembly runtime for PHP based on [Wasmer].\n\n[Wasmer]: https://github.com/wasmerio/wasmer\n\n# Features\n\n* **Easy to use**: The `wasmer` API mimics the standard WebAssembly C API,\n* **Fast**: `wasmer` executes the WebAssembly modules as fast as possible, close to **native speed**,\n* **Safe**: All calls to WebAssembly will be fast, but more importantly, completely safe and sandboxed.\n\n# Install\n\nTo install the library, follow the classical:\n\n```bash\ngit clone https://github.com/wasmerio/wasmer-php\ncd wasmer-php/ext\nphpize\n./configure --enable-wasmer\nmake\nmake test\nmake install\n```\n\n\u003e Note: Wasmer doesn't work on Windows yet.\n\n# Examples\n\n\u003cdetails\u003e\n    \u003csummary\u003eProcedural API\u003c/summary\u003e\n\n```php\n\u003c?php \n\ndeclare(strict_types=1);\n\n$engine = wasm_engine_new();\n$store = wasm_store_new($engine);\n$wasm = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'hello.wasm');\n$module = wasm_module_new($store, $wasm);\n\nfunction hello_callback() {\n    echo 'Calling back...' . PHP_EOL;\n    echo '\u003e Hello World!' . PHP_EOL;\n\n    return null;\n}\n\n$functype = wasm_functype_new(new Wasm\\Vec\\ValType(), new Wasm\\Vec\\ValType());\n$func = wasm_func_new($store, $functype, 'hello_callback');\nwasm_functype_delete($functype);\n\n$extern = wasm_func_as_extern($func);\n$externs = new Wasm\\Vec\\Extern([$extern]);\n$instance = wasm_instance_new($store, $module, $externs);\n\nwasm_func_delete($func);\n\n$exports = wasm_instance_exports($instance);\n$run = wasm_extern_as_func($exports[0]);\n\nwasm_module_delete($module);\nwasm_instance_delete($instance);\n\n$results = wasm_func_call($run, new Wasm\\Vec\\Val());\n\nwasm_store_delete($store);\nwasm_engine_delete($engine);\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eObject-oriented API\u003c/summary\u003e\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse Wasm;\n\nrequire_once __DIR__.'/../vendor/autoload.php';\n\n$engine = Wasm\\Engine::new();\n$store = Wasm\\Store::new($engine);\n\n$wasm = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'hello.wasm');\n\n$module = Wasm\\Module::new($store, $wasm);\n\nfunction hello_callback()\n{\n    echo 'Calling back...'.PHP_EOL;\n    echo '\u003e Hello World!'.PHP_EOL;\n\n    return null;\n}\n\n$functype = Wasm\\Functype::new(new Wasm\\Vec\\ValType(), new Wasm\\Vec\\ValType());\n$func = Wasm\\Module\\Func::new($store, $functype, 'hello_callback');\n\n$extern = $func-\u003easExtern();\n$externs = new Wasm\\Vec\\Extern([$extern-\u003einner()]);\n$instance = Wasm\\Module\\Instance::new($store, $module, $externs);\n\n$exports = $instance-\u003eexports();\n$run = $exports[0]-\u003easFunc();\n\n$args = new Wasm\\Vec\\Val();\n$results = $run($args);\n```\n\u003c/details\u003e\n\nThis example covers the most basic Wasm use case: we take a Wasm module (in its text representation form), create\nan instance from it, get an exported function and run it.\n\nYou can go through more advanced examples in the dedicated directories:\n* [Procedural API]\n* [Object-oriented API]\n\n[Object-oriented API]: examples\n[Procedural API]: ext/examples\n\n# Supported platforms and features\n\n## Platforms\n\n| Platform | Architecture | Status |\n|----------|--------------|:------:|\n| Linux    | `amd64`      | ✅      |\n| Linux    | `aarch64`    | ❌      |\n| Windows  | `amd64`      | ❌      |\n| Darwin   | `amd64`      | ✅      |\n| Darwin   | `aarch64`    | ❌      |\n\n| PHP | Status |\n|-----|:------:|\n| 8.0 | ✅      |\n| 7.4 | ❌      |\n| 7.3 | ❌      |\n\n## Features\n\n## Compilers and engines\n\n| Compiler   | Status |\n|------------|:------:|\n| Cranelift  | ✅      |\n| LLVM       | ❌      |\n| Singlepass | ❌      |\n\n| Engine      | Status |\n|-------------|:------:|\n| Native      | ✅      |\n| JIT         | ✅      | \n| Object File | ❌      |\n\n## Runtime\n\n| Object      | Status |\n|-------------|:------:|\n| config      | ✅      |\n| engine      | ✅      | \n| store       | ✅      |\n\n## Types\n\n| Type       | Status |\n|------------|:------:|\n| valtype    | ✅      |\n| functype   | ✅      |\n| globaltype | ✅      |\n| tabletype  | ✅      |\n| memorytype | ✅      |\n| externtype | ✅      |\n| importtype | ✅      |\n| exporttype | ✅      |\n\n## Objects\n\n| Object | Status |\n|----------|:------:|\n| val      | ✅      |\n| frame    | ✅      |\n| trap     | ✅      |\n| foreign  | ✅      |\n| module   | ✅      |\n| func     | ✅      |\n| global   | ✅      |\n| table    | 🧑‍💻      |\n| memory   | ✅      |\n| extern   | ✅      |\n| instance | ✅      |\n\n## Misc\n\n| Feature           | Status |\n|-------------------|:------:|\n| WAT               | ✅      |\n| WASI              | ❌      |\n| Cross Compilation | ❌      |\n\n# License\n\nThe entire project is under the MIT License. Please read [the\n`LICENSE` file][license].\n\n\n[license]: https://github.com/wasmerio/wasmer/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasmerio%2Fwasmer-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwasmerio%2Fwasmer-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasmerio%2Fwasmer-php/lists"}