3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function xor_encrypt($in) { $key = '<censored>'; $text = $in; $outText = ''; // Iterate through each character for($i=0;$i<strlen($text);$i++) { $outText .= $text[$i] ^ $key[$i % strlen($key)]; } return $outText; } $my_data = array( "showpassword"=>"yes", "bgcolor"=>"#ffffff"); $my_data_e = xor_encrypt($my_data); $my_data_e = xor_encrypt($my_data_e); echo $my_data_e;
Output for 5.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Warning: strlen() expects parameter 1 to be string, array given in /in/0OH6e on line 9
Output for hhvm-3.10.0
Warning: strlen() expects parameter 1 to be string, array given in /in/0OH6e on line 27
Output for 4.3.0 - 5.2.17
Notice: Array to string conversion in /in/0OH6e on line 9 Notice: Undefined offset: 0 in /in/0OH6e on line 10 Notice: Array to string conversion in /in/0OH6e on line 9 Notice: Undefined offset: 1 in /in/0OH6e on line 10 Notice: Array to string conversion in /in/0OH6e on line 9 Notice: Undefined offset: 2 in /in/0OH6e on line 10 Notice: Array to string conversion in /in/0OH6e on line 9 Notice: Undefined offset: 3 in /in/0OH6e on line 10 Notice: Array to string conversion in /in/0OH6e on line 9 Notice: Undefined offset: 4 in /in/0OH6e on line 10 Notice: Array to string conversion in /in/0OH6e on line 9 SU^C