3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a[6] = '13337.0'; $a[7] = '2'; $a[8] = 'MTExMjYyNzgxOA=='; // base64_encode('1112627818'); $a[9] = '9aaaaaaaaa'; $a[10] = '1aaaaaaaaa'; $a[1] = ''; $a[2] = '10932435112'; $a[3] = '2000e3'; $a[4] = '2e6'; define('FLAG', 'DCTF{try harder}'); define('P2', 'Password147186970!'); define('P3', 2000000); class Flag { public function __toString() { return 'Flag: '.FLAG; } } $arg = 'D'; $init = ( ( $arg == 'D' ) ? 'w' : ( $arg == '-' ) ? 't' : ( $arg == 'C' ) ? 'f' : ( $arg == 'T' ) ? 'm' : ( $arg == 'F' ) ? 'a' : 'n' ); if(isset($a[6]) && !is_array($a[6]) && strlen($a[6]) === 7 && '13337' == $a[6] && isset($a[7]) && !is_array($a[7]) && strlen($a[7]) === 1 && '2.0' == $a[7] && isset($a[8]) && !is_array($a[8]) && isset($a[9]) && !is_array($a[9]) && strlen($a[9]) === 10 && isset($a[10]) && !is_array($a[10]) && strlen($a[10]) === 10 && $a[9] + $a[10] === 10) { print 'success1<br>'; if(isset($a[1]) && strcmp($a[1], P1) == 0) { print 'success2<br>'; if(isset($a[2]) && !is_array($a[2]) && sha1(intval($a[2])) == md5(P2)) { print 'success3<br>'; if(isset($a[3]) && !is_array($a[3]) && strlen($a[3]) === 6 && isset($a[4]) && !is_array($a[4]) && strlen($a[4]) === 3 && $a[3] == $a[4] && $a[3] == P3 && $a[4] == P3) { print 'success4<br>'; $hash = md5(str_repeat($init, 3) . base64_decode($a[8]). str_repeat($init,3)); if($hash == "0") { print 'success5<br>'; $flag = serialize(new Flag()); print $flag; } } } } } //O:4:"Flag":0:{}
based on ubILK
Output for 7.2.0
Notice: A non well formed numeric value encountered in /in/A5REI on line 37 Notice: A non well formed numeric value encountered in /in/A5REI on line 37 success1<br> Warning: Use of undefined constant P1 - assumed 'P1' (this will throw an Error in a future version of PHP) in /in/A5REI on line 40
Output for 7.1.0 - 7.1.10
Notice: A non well formed numeric value encountered in /in/A5REI on line 37 Notice: A non well formed numeric value encountered in /in/A5REI on line 37 success1<br> Notice: Use of undefined constant P1 - assumed 'P1' in /in/A5REI on line 40
Output for 5.3.19 - 7.0.20
success1<br> Notice: Use of undefined constant P1 - assumed 'P1' in /in/A5REI on line 40