3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string1 = 'The lazy cat jumps over the fast fox.'; $string2 = 'The fast fox jumps over the lazy cat.'; $xor = $string1 ^ $string2; $pos=0;$len=strlen($xor); while($pos<$len) { $pos=strspn($xor,"\0",$pos); print 'Diff @'.$pos.' String1:'.$string1[$pos].' String2:'.$string2[$pos].'<br>'; $pos++; }

preferences:
45.47 ms | 402 KiB | 5 Q