3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test { private $privateProperty = "hello"; public function myMethod() { $map = array_map( function($value) use($this) { return $this->privateProperty." ".$value; }, array( "city", "world", "universe" ) ); return $map; } } $test = new Test(); print_r($test->myMethod());
Output for 5.3.0 - 5.4.17
Fatal error: Cannot use $this as lexical variable in /in/8eSuu on line 9
Process exited with code 255.