3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x=5; // globel scope function myTest() { // using x inside a function is generate an error echo "<p> variable x inside function: $x</p>" } myTest(); ?>
Output for 7.0.0 - 7.0.31, 7.1.0 - 7.1.21, 7.2.0 - 7.2.9
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /in/m58hh on line 8
Process exited with code 255.

preferences:
192.7 ms | 1395 KiB | 71 Q