3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait TestTrait { public function execute(int $id) { return $id + 1; } } class TestClass extends TestParent { use TestTrait { execute as executeTrait; } function __construct() { var_dump($this->execute(1)); var_dump($this->executeTrait(2)); } } new TestClass();
based on gMEGg
Output for 7.0.0 - 7.2.0
Fatal error: Class 'TestParent' not found in /in/gvRKc on line 11
Process exited with code 255.
Output for 5.4.2 - 5.6.28
Fatal error: Class 'TestParent' not found in /in/gvRKc on line 12
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/gvRKc on line 3
Process exited with code 255.