Files
extism/php/example/Example.php
2022-09-01 22:13:46 -06:00

10 lines
295 B
PHP

<?php
require_once "vendor/autoload.php";
$wasm = file_get_contents("../../wasm/code.wasm");
$plugin = new \Extism\Plugin($wasm);
$output = $plugin->call("count_vowels", "this is an example");
$json = json_decode(pack('C*', ...$output));
echo "Vowels counted = " . $json->{'count'} . PHP_EOL;