3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class add{ function add($a) { $d=$a+1; echo $d; } } $xin = new add(); $xin->add(1); ?>
Output for 7.1.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; add has a deprecated constructor in /in/5XDhv on line 2 Fatal error: Uncaught ArgumentCountError: Too few arguments to function add::add(), 0 passed in /in/5XDhv on line 9 and exactly 1 expected in /in/5XDhv:3 Stack trace: #0 /in/5XDhv(9): add->add() #1 {main} thrown in /in/5XDhv on line 3
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; add has a deprecated constructor in /in/5XDhv on line 2 Warning: Missing argument 1 for add::add(), called in /in/5XDhv on line 9 and defined in /in/5XDhv on line 3 Notice: Undefined variable: a in /in/5XDhv on line 5 12
Output for 5.1.0 - 5.6.28
Warning: Missing argument 1 for add::add(), called in /in/5XDhv on line 9 and defined in /in/5XDhv on line 3 Notice: Undefined variable: a in /in/5XDhv on line 5 12
Output for 5.0.0 - 5.0.5
Warning: Missing argument 1 for add::add() in /in/5XDhv on line 3 12
Output for 4.3.0 - 4.4.9
Warning: Missing argument 1 for add() in /in/5XDhv on line 3 12