Skip to content

veewee/ext-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WASM Extension for PHP

❗❗❗ EXPERIMENTAL ❗❗❗

Installation

Prerequisites:

  • rust toolchain
  • php >= 8.0 (phpdev, php-cli, php-config)
  • clang
make install

Usage

$instance = Wasm\InstanceBuilder::fromWat(
    <<<'EOWAT'
    (module
      (global $some (export "some") (mut i32) (i32.const 0))
      (func (export "get_some") (result i32) (global.get $some))
      (func (export "set_some") (param i32) (global.set $some (local.get 0))))
    EOWAT
)->build();

var_dump($instance->some);
$instance->some = 1;
var_dump($instance->some);
var_dump($instance->set_some(21));
var_dump($instance->get_some());
php examples/global.php

Check out the examples folder for more examples.

Stubs

make stubs

Roadmap

You can find a more detailed roadmap here. Feel free to give me some additional keyboards! :)

Releases

No releases published

Sponsor this project

 

Contributors 4

  •  
  •  
  •  
  •  

Languages