diff --git a/src/JsPhpize/Parser/TokenExtractor.php b/src/JsPhpize/Parser/TokenExtractor.php index 44406b5..d1d4283 100644 --- a/src/JsPhpize/Parser/TokenExtractor.php +++ b/src/JsPhpize/Parser/TokenExtractor.php @@ -176,8 +176,8 @@ protected function appendFunctionsCalls(&$value, $previousToken = null, $applica $nextValue = new Constant('constant', $nextValue->name); } - $value = $nextValue instanceof Constant && $nextValue->value === 'Array' - ? new FunctionCall(new Variable('is_array', []), [$value], []) + $value = $nextValue instanceof Constant && in_array($nextValue->value, ['Array', 'Object', 'String']) + ? new FunctionCall(new Variable('is_' . strtolower($nextValue->value), []), [$value], []) : new Dyiade('instanceof', $value, $nextValue); continue;