<?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'));
You have javascript disabled. You will not be able to edit any code.