3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $privateProperty = "hello"; public function myMethod() { $c = function($value) { return $that->privateProperty." ".$value; }; $d = $c->bindTo($this); $that = &$this; $map = array_map( $d, array( "city", "world", "universe" ) ); return $map; } } $test = new Test(); print_r($test->myMethod());

preferences:
39.77 ms | 402 KiB | 5 Q