diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-21 23:22:25 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-21 23:22:35 +0900 |
| commit | 39e6c4bfb1f3fb96bba47e3eec8e6451038a3d22 (patch) | |
| tree | 619472dd31a38ae277299495d0ff213e31093dfb /src/WebAssembly/Structure | |
| parent | 2bea3784061a33870d4678af011ffc6fc73c6ad3 (diff) | |
| download | php-waddiwasi-39e6c4bfb1f3fb96bba47e3eec8e6451038a3d22.tar.gz php-waddiwasi-39e6c4bfb1f3fb96bba47e3eec8e6451038a3d22.tar.zst php-waddiwasi-39e6c4bfb1f3fb96bba47e3eec8e6451038a3d22.zip | |
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, + }; + } } |
