3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "hello, this is evening, and this is SO"; $key = 21344124124214124324512124124; function encrypt( $text, $xorKey ) { $xored = ''; $chars = str_split( $text ); $i = 0; while ( $i < count( $chars ) ) { $xored .= chr( ord( $chars[$i] ) ^ $xorKey ); $i++; } return $xored; } $encrypted = encrypt($string, $key); echo $encrypted; // hello, this is evening, and this is SO

preferences:
37.35 ms | 402 KiB | 5 Q