3v4l.org

run code in 300+ PHP versions simultaneously
<?php function compare($left, $right) { if (($length = mb_strlen($left)) != mb_strlen($right)) { return false; } for ($i = 0, $result = 0; $i < $length; $i++) { $result |= ord($left[$i]) ^ ord($right[$i]); } return $result === 0; } var_dump(compare('Ð', 'Â'));

preferences:
24.48 ms | 406 KiB | 5 Q