3v4l.org

run code in 200+ php & hhvm versions
<?php function foo() { function bar() { echo "bar"; } bar(); } foo(); foo();

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for branch php-master
bar Fatal error: Cannot redeclare bar() (previously declared in /in/anQls:5) in /in/anQls on line 4
Process exited with code 255.
Output for branch php-master+opcache
bar Fatal error: Cannot redeclare bar() (previously declared in /in/anQls:5) in /in/anQls on line 4
Process exited with code 255.
Output for branch php-master+jit
bar Fatal error: Cannot redeclare bar() (previously declared in /in/anQls:5) in /in/anQls on line 4
Process exited with code 255.
Output for Typed properties v2
bar Fatal error: Cannot redeclare bar() (previously declared in /in/anQls:5) in /in/anQls on line 4
Process exited with code 255.
Output for Arrow functions
bar Fatal error: Cannot redeclare bar() (previously declared in /in/anQls:5) in /in/anQls on line 4
Process exited with code 255.
Output for Object typehint
bar Fatal error: Cannot redeclare bar() (previously declared in /in/anQls:5) in /in/anQls on line 4
Process exited with code 255.
Output for Array change keys
bar Fatal error: Cannot redeclare bar() (previously declared in /in/anQls:5) in /in/anQls on line 4
Process exited with code 255.
Output for Lexical anon
bar Fatal error: Cannot redeclare bar() (previously declared in /in/anQls:5) in /in/anQls on line 4
Process exited with code 255.

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page