3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler(function($errno, $errstr){ throw new Exception($errstr);}); class DateTimeCustom extends DateTime { public function __construct($datetime, $timezone = null) { try { parent::__construct($datetime, $timezone); } catch (Exception $e) { var_dump($this, parent::getLastErrors(), parent::format('c)); } } } $date = new DateTimeCustom("Funktionsansvarig rÄdgivning och juridik", "UTC");
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected ''c));' (T_ENCAPSED_AND_WHITESPACE), expecting ')' in /in/Nocnt on line 15
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ')' in /in/Nocnt on line 15
Process exited with code 255.

preferences:
193.94 ms | 1395 KiB | 65 Q