3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Tester { public function calculate($var_1,$var_2,$var_3) { $product = var_3($var_1,$var_2); echo $product; } public function returnProduct($var_1,$var_2) { return $var_1*$var_2; } } $obj = new Tester(); $obj->calculate(100,2,$obj->returnProduct);
Output for 7.0.0 - 7.3.0beta1
Notice: Undefined property: Tester::$returnProduct in /in/PYpor on line 14 Fatal error: Uncaught Error: Call to undefined function var_3() in /in/PYpor:4 Stack trace: #0 /in/PYpor(14): Tester->calculate(100, 2, NULL) #1 {main} thrown in /in/PYpor on line 4
Process exited with code 255.
Output for 5.2.6 - 5.6.28
Notice: Undefined property: Tester::$returnProduct in /in/PYpor on line 14 Fatal error: Call to undefined function var_3() in /in/PYpor on line 4
Process exited with code 255.
Output for 5.0.0 - 5.2.5
Notice: Undefined property: Tester::$returnProduct in /in/PYpor on line 14 Fatal error: Call to undefined function var_3() in /in/PYpor on line 4
Process exited with code 255.
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/PYpor 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/PYpor 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/PYpor on line 3
Process exited with code 255.