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 = 0; $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();
based on 6bRIM
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<tr><td colspan=2><table><tr>editbuttonsendbuttonsellbutton</tr></table></td></tr>