3v4l.org

run code in 300+ PHP versions simultaneously
<?php function strxor2($rhs, $lhs) { $result = ''; for ($i = 0; $i < strlen($rhs); $i++) { $result .= chr(ord($rhs[$i]) ^ ord($lhs[$i])); } return $result; } var_dump(strxor2('1', '2'));

preferences:
34.82 ms | 402 KiB | 5 Q