3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function xor_encrypt($in) { $key = 'foo'; $text = $in; $outText = ''; // Iterate through each character for($i=0;$i<strlen($text);$i++) { $outText .= $text[$i] ^ $key[$i % strlen($key)]; } return $outText; } echo xor_encrypt("foo"); ?>
based on 8Am7J
Output for 4.3.0 - 7.2.0