3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function string_to_ascii($string) { $ascii = NULL; for ($i = 0; $i < strlen($string); $i++) { $ascii += ord($string[$i]); } return($ascii); } function calc($a, $b) { $l1 = strlen($a); $l2 = strlen($b); $l = min($l1, $l2); $r = ''; for($i = 0; $i < $l; $i++) { $r .= chr(ord($a[$i]) ^ ord($b[$i])); } return $r; } $a = "8112yuyuiuoui"; $b = "p90187opoipi[i[o[bnmmvhfdfhgj"; var_dump(calc($a, $b)); var_dump($a ^ $b);
Output for 5.6.0 - 7.3.0alpha1
string(13) "HAB2" string(13) "HAB2"