3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { function editbutton() { return 'editbutton'; } function sendbutton() { return 'sendbutton'; } function sellbutton() { return 'sellbutton'; } function cancelbutton() { return 'cancelbutton'; } function set_buttons() { $s = 1; $buttons = "<tr><td colspan=2><table><tr>"; if ($s == 0) { $buttons .= $this->editbutton().$this->sendbutton().$this->sellbutton(); } if ($s == 1) { $buttons .= $this->cancelbutton(); } $buttons .= "</tr></table></td></tr>"; echo $buttons; } } } $a = new A(); $a->set_buttons();
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.4.34
Parse error: syntax error, unexpected '}' in /in/iXDbv on line 24
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '}' in /in/iXDbv on line 24
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/iXDbv on line 24
Process exited with code 255.