3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen_secured_random() { // cause random is the way $a = rand(1337,2600)*42; $b = rand(1879,1955)*42; $a < $b ? $a ^= $b ^= $a ^= $b : $a = $b; return $a+$b; } function secured_hash_function($plain) { // cause md5 is the best hash ever $secured_plain = sanitize_user_input($plain); return md5($secured_plain); } function sanitize_user_input($input) { // cause someone told me to never trust user input $re = '/[^a-zA-Z0-9]/'; $secured_input = preg_replace($re, "", $input); return $secured_input; } $s = 's'; $h ='h'; print "s => "; var_dump($s); print "h => "; var_dump($h); if (isset($s) && isset($h )) { $s = sanitize_user_input($s); $h = secured_hash_function($h); $r = gen_secured_random(); echo "strans => " ; var_dump($s); echo "htrans => " ; var_dump($h); echo "rtrans => " ; var_dump($r); if($s != false && $h != false) { if($s.$r == $h) { print "Well done! Here is your flag: "; } else { print "Fail..."; } } else { print "<p>Hum ...</p>"; } } ?>
Output for 7.2.2
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(142380) Fail...
Output for 7.2.1
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(144438) Fail...
Output for 7.2.0
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(162540) Fail...
Output for 7.1.14
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(159180) Fail...
Output for 7.1.13
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(160776) Fail...
Output for 7.1.12
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(138180) Fail...
Output for 7.1.11
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(161448) Fail...
Output for 7.1.10
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(158676) Fail...
Output for 7.1.9
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(155442) Fail...
Output for 7.1.8
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(144396) Fail...
Output for 7.1.7
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(160188) Fail...
Output for 7.1.6
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(161784) Fail...
Output for 7.1.5
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(159768) Fail...
Output for 7.1.4
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(159600) Fail...
Output for 7.1.3
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(141666) Fail...
Output for 7.1.2
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(158844) Fail...
Output for 7.1.1
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(160524) Fail...
Output for 7.1.0
s => string(1) "s" h => string(1) "h" strans => string(1) "s" htrans => string(32) "2510c39011c5be704182423e3a695e91" rtrans => int(158088) Fail...

preferences:
57.48 ms | 402 KiB | 23 Q