diff options
Diffstat (limited to 'crates/shirabe-php-shim')
| -rw-r--r-- | crates/shirabe-php-shim/src/lib.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs index 381a56a..4b2ea87 100644 --- a/crates/shirabe-php-shim/src/lib.rs +++ b/crates/shirabe-php-shim/src/lib.rs @@ -468,8 +468,12 @@ pub fn is_scalar(_value: &PhpMixed) -> bool { ) } -pub fn is_numeric(_value: &PhpMixed) -> bool { - todo!() +pub fn is_numeric(value: &PhpMixed) -> bool { + match value { + PhpMixed::Int(_) | PhpMixed::Float(_) => true, + PhpMixed::String(s) => is_numeric_string(s), + _ => false, + } } pub fn strtotime(_time: &str) -> Option<i64> { |
