3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class myclass{ public function add($nam,$y){ return $nam+$y; } public function mult($nam,$y){ return $nam*$y; } } $surname= new myclass(12,6); echo $surname->add(); echo $surname->mult();
based on WjLMo
Output for 7.1.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function myclass::add(), 0 passed in /in/FjYRk on line 13 and exactly 2 expected in /in/FjYRk:3 Stack trace: #0 /in/FjYRk(13): myclass->add() #1 {main} thrown in /in/FjYRk on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Warning: Missing argument 1 for myclass::add(), called in /in/FjYRk on line 13 and defined in /in/FjYRk on line 3 Warning: Missing argument 2 for myclass::add(), called in /in/FjYRk on line 13 and defined in /in/FjYRk on line 3 Notice: Undefined variable: nam in /in/FjYRk on line 5 Notice: Undefined variable: y in /in/FjYRk on line 5 0 Warning: Missing argument 1 for myclass::mult(), called in /in/FjYRk on line 15 and defined in /in/FjYRk on line 7 Warning: Missing argument 2 for myclass::mult(), called in /in/FjYRk on line 15 and defined in /in/FjYRk on line 7 Notice: Undefined variable: nam in /in/FjYRk on line 9 Notice: Undefined variable: y in /in/FjYRk on line 9 0
Output for hhvm-3.10.0 - 3.12.0
Warning: add() expects exactly 2 parameters, 0 given in /in/FjYRk on line 5 Notice: Undefined variable: y in /in/FjYRk on line 5 Notice: Undefined variable: nam in /in/FjYRk on line 5 0 Warning: mult() expects exactly 2 parameters, 0 given in /in/FjYRk on line 9 Notice: Undefined variable: y in /in/FjYRk on line 9 Notice: Undefined variable: nam in /in/FjYRk on line 9 0
Output for 5.1.0 - 5.6.28
Warning: Missing argument 1 for myclass::add(), called in /in/FjYRk on line 13 and defined in /in/FjYRk on line 3 Warning: Missing argument 2 for myclass::add(), called in /in/FjYRk on line 13 and defined in /in/FjYRk on line 3 Notice: Undefined variable: y in /in/FjYRk on line 5 Notice: Undefined variable: nam in /in/FjYRk on line 5 0 Warning: Missing argument 1 for myclass::mult(), called in /in/FjYRk on line 15 and defined in /in/FjYRk on line 7 Warning: Missing argument 2 for myclass::mult(), called in /in/FjYRk on line 15 and defined in /in/FjYRk on line 7 Notice: Undefined variable: y in /in/FjYRk on line 9 Notice: Undefined variable: nam in /in/FjYRk on line 9 0
Output for 5.0.0 - 5.0.5
Warning: Missing argument 1 for myclass::add() in /in/FjYRk on line 3 Warning: Missing argument 2 for myclass::add() in /in/FjYRk on line 3 0 Warning: Missing argument 1 for myclass::mult() in /in/FjYRk on line 7 Warning: Missing argument 2 for myclass::mult() in /in/FjYRk on line 7 0
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/FjYRk on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/FjYRk on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/FjYRk on line 3
Process exited with code 255.