3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if(function_exists('phpversion')) $phpv=phpversion(); else $phpv=PHP_VERSION; if($phpv >= "5.2.1") $td = sys_get_temp_dir(); else $td = "/tmp"; $tmp1=$td.'/sess_'.'md5(date("YmdH"))'; $tmp2=$td.'/sess_'.'md5(date("YmdHs"))'; $tmp3=$td.'/sess_'.'md5(date("YmdHsM"))'; $cntnt="ZWNobyAncmFkaSA6RCc7"; $bb64=chr(98).chr(97).chr(115).chr(101).chr(54).chr(52).chr(95).chr(100).chr(101).chr(99).chr(111).chr(100).chr(101); $f=fopen($tmp1,"w"); fwrite($f, '<?php $g=fopen("' . $tmp2 . '","w"); fwrite($g,\'<?php $h=fopen("' . $tmp3 . '","w"); fwrite($h,"<?php " . ' . $bb64 . '("'.$cntnt.'") . ";"); fclose($h);\' ); fclose($g); ' ); fclose($f); #echo "---1--"; #echo file_get_contents($tmp1); echo "--12---"; include($tmp1); #echo file_get_contents($tmp2); echo "--23---"; include($tmp2); #echo file_get_contents($tmp3); echo "--3---"; include($tmp3); unlink($tmp1); unlink($tmp2); unlink($tmp3);
Output for 7.0.0 - 7.2.0
Parse error: syntax error, unexpected 'YmdHs' (T_STRING), expecting ',' or ')' in /tmp/sess_md5(date("YmdH")) on line 2
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Parse error: syntax error, unexpected 'YmdHs' (T_STRING) in /tmp/sess_md5(date("YmdH")) on line 2
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /tmp/sess_md5(date("YmdH")) on line 2
Process exited with code 255.