3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Foo { function __lambda_func() { return print 'no'; } } namespace Bar { function yuno($x) { $x(); } } namespace { function __lambda_func() { return print 'no'; } Bar\yuno(function() { return print 'OK'; }); $fn = create_function("", "return 'OK';"); var_dump($fn()); }
based on gUCm0
Output for 7.2.0
OK Deprecated: Function create_function() is deprecated in /in/7bGg5 on line 22 Fatal error: Cannot redeclare __lambda_func() (previously declared in /in/7bGg5:17) in /in/7bGg5(22) : runtime-created function on line 1
Process exited with code 255.
Output for 5.3.19 - 7.1.10
OK Fatal error: Cannot redeclare __lambda_func() (previously declared in /in/7bGg5:17) in /in/7bGg5(22) : runtime-created function on line 1
Process exited with code 255.