Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
W

wasmer-php

> 编程语言
Open source

️ WebAssembly runtime for PHP

1.1K stars0 likes0 views
WebsiteGitHub

About

️ WebAssembly runtime for PHP

A complete and mature WebAssembly runtime for PHP based on Wasmer.

Features

  • Easy to use: The wasmer API mimics the standard WebAssembly C API,
  • Fast: wasmer executes the WebAssembly modules as fast as possible, close to native speed,
  • Safe: All calls to WebAssembly will be fast, but more importantly, completely safe and sandboxed.

Install

To install the library, follow the classical:

bash
git clone https://github.com/wasmerio/wasmer-php
cd wasmer-php/ext
phpize
./configure --enable-wasmer
make
make test
make install

Note: Wasmer doesn't work on Windows yet.

Examples

Procedural API
…
Object-oriented API
php
 Hello World!'.PHP_EOL;

    return null;
}

$functype = Wasm\Functype::new(new Wasm\Vec\ValType(), new Wasm\Vec\ValType());
$func = Wasm\Module\Func::new($store, $functype, 'hello_callback');

$extern = $func->asExtern();
$externs = new Wasm\Vec\Extern([$extern->inner()]);
$instance = Wasm\Module\Instance::new($store, $module, $externs);

$exports = $instance->exports();
$run = $exports[0]->asFunc();

$args = new Wasm\Vec\Val();
$results = $run($args);

This example covers the most basic Wasm use case: we take a Wasm module (in its text representation form), create an instance from it, get an exported function and run it.

You can go through more advanced examples in the dedicated directories:

  • Procedural API
  • Object-oriented API

Supported platforms and features

Platforms

Platform Architecture Status
Linux amd64 ✅
Linux aarch64 ❌
Windows amd64 ❌
Darwin amd64 ✅
Darwin aarch64 ❌
PHP Status
8.0 ✅
7.4 ❌
7.3 ❌

Features

Compilers and engines

Compiler Status
Cranelift ✅
LLVM ❌
Singlepass ❌
Engine Status
Native ✅
JIT ✅
Object File ❌

Runtime

Object Status
config ✅
engine ✅
store ✅

Types

Type Status
valtype ✅
functype ✅
globaltype ✅
tabletype ✅
memorytype ✅
externtype ✅
importtype ✅
exporttype ✅

Objects

Object Status
val ✅
frame ✅
trap ✅
foreign ✅
module ✅
func ✅
global ✅
table ‍
memory ✅
extern ✅
instance ✅

Misc

Feature Status
WAT ✅
WASI ❌
Cross Compilation ❌

License

The entire project is under the MIT License. Please read the LICENSE file.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPphpphp-extensionrustwasm

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言