3v4l.org

run code in 200+ 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 = base64_encode(xor_encrypt(json_encode(my_data))); $my_data_e = base64_encode(xor_encrypt(json_encode("matriux"))); $tempdata = json_decode(xor_encrypt(base64_decode(my_data_e)), true); echo $tempdata;
based on rTcYQ
Output for 7.2.0
Warning: Use of undefined constant my_data_e - assumed 'my_data_e' (this will throw an Error in a future version of PHP) in /in/L6GK4 on line 21
Output for 5.2.0 - 7.1.10
Notice: Use of undefined constant my_data_e - assumed 'my_data_e' in /in/L6GK4 on line 21
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_encode() in /in/L6GK4 on line 20
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_encode() in /in/L6GK4 on line 20
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_encode() in /in/L6GK4 on line 20
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_encode() in /in/L6GK4 on line 20