3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class ClassLoader { private $classMap = 'Class Map'; } $loader = new ClassLoader; $func_without_closure_bind = function() use ($loader) { var_dump($loader->classMap); }; $func_with_closure_bind = Closure::bind($func_without_closure_bind, null, ClassLoader::class); $func_with_closure_bind(); //$func_without_closure_bind(); var_dump($laoder);
based on UpZvI
Output for 5.6.0 - 7.3.0alpha1
string(9) "Class Map" Notice: Undefined variable: laoder in /in/LXTap on line 17 NULL