diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-07-29 18:23:59 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-10-18 19:47:13 +0900 |
| commit | a0ec6fc11cbb68d5912e850b9f73b94f4560d510 (patch) | |
| tree | 070ab472bb1bd3c5bb739b2b19052d1083fe9acd /src/WebAssembly/Structure | |
| parent | 2656a7d724c2738bd8fa8d3a876a1228642bf54e (diff) | |
| download | php-waddiwasi-validation.tar.gz php-waddiwasi-validation.tar.zst php-waddiwasi-validation.zip | |
wipvalidation
Diffstat (limited to 'src/WebAssembly/Structure')
| -rw-r--r-- | src/WebAssembly/Structure/Types/ValType.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/WebAssembly/Structure/Types/ValType.php b/src/WebAssembly/Structure/Types/ValType.php index ace4604..02e1113 100644 --- a/src/WebAssembly/Structure/Types/ValType.php +++ b/src/WebAssembly/Structure/Types/ValType.php @@ -13,4 +13,28 @@ enum ValType case V128; case FuncRef; case ExternRef; + + public function isNum(): bool + { + return match ($this) { + ValType::I32 , ValType::I64 , ValType::F32 , ValType::F64 => true, + default => false, + }; + } + + public function isVec(): bool + { + return match ($this) { + ValType::V128 => true, + default => false, + }; + } + + public function isRef(): bool + { + return match ($this) { + ValType::FuncRef , ValType::ExternRef => true, + default => false, + }; + } } |
