3v4l.org

run code in 500+ PHP versions simultaneously
<?php function cmp_strict(mixed $a, mixed $b): int { if ($a === $b) return 0; $typeA = gettype($a); $typeB = gettype($b); if ($typeA === $typeB) { // abstract function to compare values without type juggling return cmp_values_strict($a, $b); } else { return $typeA <=> $typeB; } } var_dump(cmp_strict(0, '0'));

preferences:
21.08 ms | 475 KiB | 4 Q