aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/rubyvm-on-php-on-wasm/php-wasm.php
diff options
context:
space:
mode:
Diffstat (limited to 'examples/rubyvm-on-php-on-wasm/php-wasm.php')
-rw-r--r--examples/rubyvm-on-php-on-wasm/php-wasm.php4
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/rubyvm-on-php-on-wasm/php-wasm.php b/examples/rubyvm-on-php-on-wasm/php-wasm.php
index 704254f..fa17f27 100644
--- a/examples/rubyvm-on-php-on-wasm/php-wasm.php
+++ b/examples/rubyvm-on-php-on-wasm/php-wasm.php
@@ -6,7 +6,6 @@ require_once __DIR__ . '/vendor/autoload.php';
use Nsfisis\Waddiwasi\BinaryFormat\Decoder;
use Nsfisis\Waddiwasi\BinaryFormat\InvalidBinaryFormatException;
-use Nsfisis\Waddiwasi\Execution\ExternVal;
use Nsfisis\Waddiwasi\Execution\FuncInst;
use Nsfisis\Waddiwasi\Execution\MemInst;
use Nsfisis\Waddiwasi\Execution\Refs;
@@ -131,8 +130,7 @@ $hostFuncs = [
$store = Store::empty();
$externVals = [];
foreach ($hostFuncs as $hostFunc) {
- $store->funcs[] = $hostFunc;
- $externVals[] = ExternVal::Func(\count($store->funcs) - 1);
+ $externVals[] = $store->registerFunc($hostFunc);
}
$runtime = Runtime::instantiate($store, $module, $externVals);
$codePtr = allocateStringOnWasmMemory($runtime, strtr(PHP_HELLO_WORLD, ['%DIR%' => __DIR__]));