aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-31 16:29:36 +0900
committernsfisis <nsfisis@gmail.com>2024-08-31 16:29:48 +0900
commit487509c913cd4e8255ceb4f6bb19c3abea511789 (patch)
treee1860ab80c7ac1e672b317c85cacbd5718e9581b /examples
parent699f6ef036ed8eb01c1b4fb386464fabf5fa9443 (diff)
downloadphp-waddiwasi-487509c913cd4e8255ceb4f6bb19c3abea511789.tar.gz
php-waddiwasi-487509c913cd4e8255ceb4f6bb19c3abea511789.tar.zst
php-waddiwasi-487509c913cd4e8255ceb4f6bb19c3abea511789.zip
chore: format
Diffstat (limited to 'examples')
-rw-r--r--examples/php-on-wasm/php-wasm.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/php-on-wasm/php-wasm.php b/examples/php-on-wasm/php-wasm.php
index 78196d6..2401985 100644
--- a/examples/php-on-wasm/php-wasm.php
+++ b/examples/php-on-wasm/php-wasm.php
@@ -190,7 +190,8 @@ function makeHostFunc(string $typeDef, callable $fn): Externs\Func
'f64' => ValType::F64,
default => throw new \RuntimeException('Invalid type: ' . $s),
};
- preg_match('/^\(([^)]*)\) -> \(([^)]*)\)$/', $typeDef, $matches);
+ $ok = preg_match('/^\(([^)]*)\) -> \(([^)]*)\)$/', $typeDef, $matches);
+ \assert($ok === 1);
$paramsDef = $matches[1];
$resultsDef = $matches[2];
$params = array_map($stringToType, $paramsDef === '' ? [] : explode(', ', $paramsDef));