3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(isset($_GET['stats'])) { $stats = json_decode(file_get_contents('stats.json')); echo '<h1>Hits: '.$stats->hits.'</h1>'; echo "STATS WAS SET"; } else { // STATS WAS NOT SET $stats = json_decode(file_get_contents('stats.json')); $stats->hits++; file_put_contents('stats.json', json_encode($stats)); echo "STATS WAS NOT SET"; header("Location: http://www.bjcstcharlescounty.org/"); } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: file_get_contents(): open_basedir restriction in effect. File(stats.json) is not within the allowed path(s): (/tmp:/in:/etc) in /in/JdJ0E on line 8 Warning: file_get_contents(stats.json): Failed to open stream: Operation not permitted in /in/JdJ0E on line 8 Fatal error: Uncaught Error: Attempt to increment/decrement property "hits" on null in /in/JdJ0E:9 Stack trace: #0 {main} thrown in /in/JdJ0E on line 9
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
65.51 ms | 402 KiB | 8 Q