3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0alpha3 - rc2
Fatal error: Uncaught Error: Class "TestParent" not found in /in/gvRKc:11 Stack trace: #0 {main} thrown in /in/gvRKc on line 11
Process exited with code 255.
Output for 7.3.0 - 7.3.23, 7.4.0 - 7.4.12, 8.0.0alpha1 - alpha2
Fatal error: Uncaught Error: Class 'TestParent' not found in /in/gvRKc:11 Stack trace: #0 {main} thrown in /in/gvRKc on line 11
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33
Fatal error: Class 'TestParent' not found in /in/gvRKc on line 11
Process exited with code 255.
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Fatal error: Class 'TestParent' not found in /in/gvRKc on line 12
Process exited with code 255.