3v4l.org

run code in 200+ PHP versions simultaneously
<?php class Monkey{} $gibbon = new Monkey; $gibbon->name = 'Librarian'; function splort() { global $gibbon; if($gibbon->name == 'Librarian') echo "Ook."; else echo 'Boing!'; } register_shutdown_function('splort'); echo "Time for go to bed.";
Output for 4.3.0 - 7.4.0
Time for go to bed.Ook.