3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class test { var $a; function test($a) { $a = 'OK'; } } $test = new test(); print $test->test();
Output for 7.1.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/ca5RK on line 2 Fatal error: Uncaught ArgumentCountError: Too few arguments to function test::test(), 0 passed in /in/ca5RK on line 10 and exactly 1 expected in /in/ca5RK:5 Stack trace: #0 /in/ca5RK(10): test->test() #1 {main} thrown in /in/ca5RK on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.14
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/ca5RK on line 2 Warning: Missing argument 1 for test::test(), called in /in/ca5RK on line 10 and defined in /in/ca5RK on line 5 Warning: Missing argument 1 for test::test(), called in /in/ca5RK on line 12 and defined in /in/ca5RK on line 5
Output for hhvm-3.10.0 - 3.12.0
Warning: test() expects exactly 1 parameter, 0 given in /in/ca5RK on line 6 Warning: test() expects exactly 1 parameter, 0 given in /in/ca5RK on line 6
Output for 5.1.3 - 5.6.28
Warning: Missing argument 1 for test::test(), called in /in/ca5RK on line 10 and defined in /in/ca5RK on line 5 Warning: Missing argument 1 for test::test(), called in /in/ca5RK on line 12 and defined in /in/ca5RK on line 5
Output for 5.1.0 - 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/ca5RK on line 3 Warning: Missing argument 1 for test::test(), called in /in/ca5RK on line 10 and defined in /in/ca5RK on line 5 Warning: Missing argument 1 for test::test(), called in /in/ca5RK on line 12 and defined in /in/ca5RK on line 5
Output for 5.0.0 - 5.0.5
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/ca5RK on line 3 Warning: Missing argument 1 for test::test() in /in/ca5RK on line 5 Warning: Missing argument 1 for test::test() in /in/ca5RK on line 5
Output for 4.3.0 - 4.4.9
Warning: Missing argument 1 for test() in /in/ca5RK on line 5 Warning: Missing argument 1 for test() in /in/ca5RK on line 5