3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { public function __constructor(){ echo 'oki'; } public function Test($x){ echo $x; } } $t1 = new Test(); $t2 = new Test(100);
based on vFt6e
Output for 7.1.0 - 7.2.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Test has a deprecated constructor in /in/jZ0Ld on line 3 Fatal error: Uncaught ArgumentCountError: Too few arguments to function Test::Test(), 0 passed in /in/jZ0Ld on line 9 and exactly 1 expected in /in/jZ0Ld:6 Stack trace: #0 /in/jZ0Ld(9): Test->Test() #1 {main} thrown in /in/jZ0Ld on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Test has a deprecated constructor in /in/jZ0Ld on line 3 Warning: Missing argument 1 for Test::Test(), called in /in/jZ0Ld on line 9 and defined in /in/jZ0Ld on line 6 Notice: Undefined variable: x in /in/jZ0Ld on line 6 100
Output for 5.3.19 - 5.6.28
Warning: Missing argument 1 for Test::Test(), called in /in/jZ0Ld on line 9 and defined in /in/jZ0Ld on line 6 Notice: Undefined variable: x in /in/jZ0Ld on line 6 100