3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class DateTimeAttribute extends DateTime { private $datetime = ''; public function __construct($datetime) { try { parent::__construct($datetime); } catch (e) {} $this->datetime = $datetime; } public function __toString() { return $this->datetime; } } $x = new DateTimeAttribute('2013-04-01 2x40:06'); echo $x; echo "\n"; echo $x->format('Y s');
Output for 5.4.0 - 5.4.13
Parse error: syntax error, unexpected ')', expecting variable (T_VARIABLE) in /in/fuTBL on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.23
Parse error: syntax error, unexpected ')', expecting T_VARIABLE in /in/fuTBL on line 10
Process exited with code 255.