mirror of
https://github.com/extism/extism.git
synced 2026-04-23 03:00:11 -04:00
chore: prepare repo for php packagist release
This commit is contained in:
10
php/example/Example.php
Normal file
10
php/example/Example.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
require("Plugin.php");
|
||||
|
||||
$wasm = file_get_contents("../wasm/code.wasm");
|
||||
$plugin = new Plugin($wasm);
|
||||
|
||||
$output = $plugin->call("count_vowels", "this is an example");
|
||||
$json = json_decode(pack('C*', ...$output));
|
||||
echo "Vowels counted = " . $json->{'count'} . PHP_EOL;
|
||||
Reference in New Issue
Block a user