3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function xor_encrypt($in, $key) { $outText = ''; // Iterate through each character for($i=0;$i<strlen($in);$i++) { $outText .= $in[$i] ^ $key[$i % strlen($key)]; } return $outText; } $b64_decoded_cookie = base64_decode("ClVLIh4ASCsCBE8lAxMacFMZV2hdVVotEhhUJQNVAmhSEV4sFxFeaAw%3D"); $defaultdata = array( "showpassword"=>"no", "bgcolor"=>"#ffffff"); $my_data_e = base64_encode(xor_encrypt(json_encode($defaultdata))); $key = xor_encrypt(json_encode($defaultdata), $b64_decoded_cookie); echo $key; //echo $my_data_e;
based on ULenU
Output for 7.1.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function xor_encrypt(), 1 passed in /in/JtdQ0 on line 17 and exactly 2 expected in /in/JtdQ0:3 Stack trace: #0 /in/JtdQ0(17): xor_encrypt('{"showpassword"...') #1 {main} thrown in /in/JtdQ0 on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Warning: Missing argument 2 for xor_encrypt(), called in /in/JtdQ0 on line 17 and defined in /in/JtdQ0 on line 3 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Fatal error: Uncaught DivisionByZeroError: Modulo by zero in /in/JtdQ0:8 Stack trace: #0 /in/JtdQ0(17): xor_encrypt('{"showpassword"...') #1 {main} thrown in /in/JtdQ0 on line 8
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Warning: xor_encrypt() expects exactly 2 parameters, 1 given in /in/JtdQ0 on line 4 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 qw8Jqw8Jqw8Jqw8Jqw8Jqw8Jqw8Jqw8Jqw8Jqw8Jq
Output for 5.2.0 - 5.6.28
Warning: Missing argument 2 for xor_encrypt(), called in /in/JtdQ0 on line 17 and defined in /in/JtdQ0 on line 3 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 Warning: Division by zero in /in/JtdQ0 on line 8 Notice: Undefined variable: key in /in/JtdQ0 on line 8 qw8Jqw8Jqw8Jqw8Jqw8Jqw8Jqw8Jqw8Jqw8Jqw8Jq
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.1.6
Fatal error: Call to undefined function json_encode() in /in/JtdQ0 on line 17
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/JtdQ0 on line 22
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_encode() in /in/JtdQ0 on line 17
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_encode() in /in/JtdQ0 on line 17
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_encode() in /in/JtdQ0 on line 17