3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('display_errors', 1); $a = function($b) { print "$b\n"; }; $a('lulz'); $b['lulz'] = function($b) { print "$b\n"; }; $b['lulz']('more lulz'); class c { protected $b; public function __construct() { $this->b = function($b) { print "hahahaha\n"; }; } public function __call($b, $args) { return $this->{$b}($args); } } $c = new c; $c->b('asdf');

preferences:
37.46 ms | 402 KiB | 5 Q