3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo file_get_contents(__FILE__); echo PHP_EOL . '=============' . PHP_EOL; system('& id');
based on K73PL
Output for 5.4.39 - 7.1.0
<?php echo file_get_contents(__FILE__); echo PHP_EOL . '=============' . PHP_EOL; system('& id'); =============
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.4.38
<?php echo file_get_contents(__FILE__); echo PHP_EOL . '=============' . PHP_EOL; system('& id'); ============= sh: 1: Syntax error: "&" unexpected
Output for 4.3.1 - 4.3.9, 5.0.0 - 5.0.1
<?php echo file_get_contents(__FILE__); echo PHP_EOL . '=============' . PHP_EOL; system('& id'); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ML0Lk on line 3 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ML0Lk on line 3 PHP_EOL=============PHP_EOLsh: 1: Syntax error: "&" unexpected
Output for 4.3.0
<?php echo file_get_contents(__FILE__); echo PHP_EOL . '=============' . PHP_EOL; system('& id'); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ML0Lk on line 3 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ML0Lk on line 3 PHP_EOL=============PHP_EOL