3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Foo\Bar; use Something as D; class A extends B { function foo($foo, $bar) { return $foo * $bar; } } class C extends D { } class D extends E { }
Output for 5.6.30, 7.0.7 - 7.2.9
Fatal error: Cannot declare class Foo\Bar\D because the name is already in use in /in/HT7IE on line 12
Process exited with code 255.
Output for 7.0.0 - 7.0.6
Fatal error: Class 'Foo\Bar\B' not found in /in/HT7IE on line 5
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: Cannot declare class Foo\Bar\D because the name is already in use: (Line: 13, Char: 1) in /in/HT7IE:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.15.4 - 3.21.3
Fatal error: Uncaught Error: Cannot declare class Foo\Bar\D because the name is already in use: (Line: 13, Char: 1) in /in/HT7IE:12 Stack trace: #0 {main}
Process exited with code 255.