From 487509c913cd4e8255ceb4f6bb19c3abea511789 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 31 Aug 2024 16:29:36 +0900 Subject: chore: format --- examples/php-on-wasm/php-wasm.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples') 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)); -- cgit v1.2.3-70-g09d2