3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<? class ListᐸTᐳ { private $items = []; public function add(T $item) { $this->items[] = $item; } } class T extends DateTime {} class ListᐸDateTime extends ListᐸTᐳ {} $list = new ListᐸDateTimeᐳ(); $list->add(new DateTime('now'));
based on Gg4IZ
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught Error: Class 'ListᐸDateTimeᐳ' not found in /in/jL7hr:16 Stack trace: #0 {main} thrown in /in/jL7hr on line 16
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Class undefined: ListᐸDateTimeᐳ in /in/jL7hr:16 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Class 'ListᐸDateTimeᐳ' not found in /in/jL7hr on line 16
Process exited with code 255.