3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public function bar() { throw new Exception ('foobar'); } } $a = new Foo; try{ $a->bar(); } catch( $e ) { echo $e->getMessage(); }
Output for 5.4.0 - 5.4.8
Parse error: syntax error, unexpected '$e' (T_VARIABLE), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/1dg84 on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.18
Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING or T_NAMESPACE or T_NS_SEPARATOR in /in/1dg84 on line 14
Process exited with code 255.