3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class IbmApiExceptionDB extends Exception { private $messages = array(); public function setMessage($messageLabel, $msgArgs = null, $moduleName = null) { if (is_array($messageLabel)) { $this->messages = $messageLabel; $messageLabel = ''; } //parent::setMessage($messageLabel, $msgArgs, $moduleName); } public function getMessages() { return $this->messages; } } try { $exception = new IbmApiExceptionDB(); $exception->setMessage(array(1,2,3)); throw $exception; } catch ($e) { echo 111; }
based on boBSQ
Output for 5.4.0 - 5.4.34
Parse error: syntax error, unexpected '$e' (T_VARIABLE), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/u5oo2 on line 26
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING or T_NAMESPACE or T_NS_SEPARATOR in /in/u5oo2 on line 26
Process exited with code 255.
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING in /in/u5oo2 on line 26
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_VARIABLE, expecting T_STRING in /in/u5oo2 on line 26
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/u5oo2 on line 5
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/u5oo2 on line 5
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/u5oo2 on line 5
Process exited with code 255.