Download the PHP package kingbes/wasm without Composer
On this page you can find all versions of the php package kingbes/wasm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package wasm
php-wasm
通过 PHP FFI 调用 C 动态库,以编程方式构建 WebAssembly (Wasm) 模块的 PHP 库。
特性
- 纯 PHP 代码生成 Wasm 二进制模块
- 支持完整的 Wasm 指令集(算术、位运算、比较、控制流、内存、引用等)
- 支持 debug 模式,生成带调试信息的 Wasm 模块
- 链式调用 API 设计,代码更简洁
- 支持函数导入/导出、全局变量、内存管理、数据段等
环境要求
- PHP >= 8.2
- 启用 FFI 扩展 (
ext-ffi) - Windows Linux Macos
安装
快速开始
核心类
| 类 | 说明 |
|---|---|
Module |
Wasm 模块管理:创建函数、全局变量、内存、数据段、编译输出 |
Func |
Wasm 函数体编写:常量、变量、算术、位运算、比较、控制流、内存、引用等指令 |
ValType |
值类型枚举:I32, I64, F32, F64, V128, FuncRef, ExternRef |
NumType |
数值类型枚举:I32, I64, F32, F64 |
RefType |
引用类型枚举:FuncRef, ExternRef |
ConstExpression |
常量表达式,用于全局变量初始化 |
FunType |
函数类型对象,用于 debug 模式 |
详细文档
| 文档 | 说明 |
|---|---|
| Module 类 | 模块创建、函数管理、全局变量、内存、数据段、编译 |
| Func 类 | 函数体指令:常量、局部/全局变量、算术、位运算、比较、类型转换、控制流、内存、引用 |
| 类型枚举 | ValType、NumType、RefType 枚举说明 |
| ConstExpression | 常量表达式与全局变量初始化 |
| 使用示例 | 完整使用示例:加法函数、循环、条件分支、内存操作等 |
项目结构
License
MIT
All versions of wasm with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.2
ext-ffi Version *
ext-ffi Version *
The package kingbes/wasm contains the following files
Loading the files please wait ...