3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<span class="notranslate" onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><?php class MyException extends Exception { public function __construct($message, $code=0, Exception $previous = null) { parent::__construct($message,$code,$previous);</span> <?PHP类MyException扩展异常{公共职能__construct($消息,$代码= 0,异常元上= NULL){父:: __结构($消息,$代码,元上);</span> <span class="notranslate" onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">} public function __toString() { return __CLASS__.</span> }公共职能__toString(){返回__CLASS__。</span> <span class="notranslate" onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">":[{$this->code}]:{$this->message}\n";</span> “:[{$本>代码}]:{$此>消息} \ N”;</span> <span class="notranslate" onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">} } throw new MyException("Foo");</span> }}抛出新MyException(“富”);</span>
Output for 5.1.0 - 5.4.32
Parse error: syntax error, unexpected '<' in /in/rjZlA on line 1
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected '<' in /in/rjZlA on line 1
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/rjZlA on line 1
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/rjZlA on line 1
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/rjZlA on line 1
Process exited with code 255.