3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class testClass { function testClass () { echo 'Output string!'; } } class testClass2 extends testClass { function __construct () { call_user_func(array('parent', '__construct')); } } new testClass2;
Output for 7.0.0 - 7.1.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; testClass has a deprecated constructor in /in/P4mXD on line 2 Output string!
Output for 4.3.0 - 4.4.9, 5.3.2 - 5.6.28
Output string!
Output for 5.3.0 - 5.3.1

Process exited with code 139.
Output for 5.0.0 - 5.1.1, 5.1.3 - 5.2.17
Warning: call_user_func(parent::__construct): First argument is expected to be a valid callback in /in/P4mXD on line 14
Output for 5.1.2
Strict Standards: Non-static method testClass::__construct() cannot be called statically, assuming $this from compatible context testClass2 in /in/P4mXD on line 14 Warning: call_user_func(parent::__construct): First argument is expected to be a valid callback in /in/P4mXD on line 14