3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach(range('a', 'z') as $letter){ try{ $date = new \DateTime($letter); var_dump($date); } catch(Exception $e){ var_dump($e); } }

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for branch master
object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.000287" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "A" } object(DateTime)#2 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.000485" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "B" } object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.000643" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "C" } object(DateTime)#2 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.000799" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "D" } object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.000954" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "E" } object(DateTime)#2 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.001119" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "F" } object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.001284" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "G" } object(DateTime)#2 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.001446" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "H" } object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.001609" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "I" } object(Exception)#3 (8) { ["message":protected]=> string(123) "DateTime::__construct(): Failed to parse time string (j) at position 0 (j): The timezone could not be found in the database" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/2ql2Q" ["line":protected]=> int(4) ["trace":"Exception":private]=> array(1) { [0]=> array(6) { ["file"]=> string(9) "/in/2ql2Q" ["line"]=> int(4) ["function"]=> string(11) "__construct" ["class"]=> string(8) "DateTime" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> string(1) "j" } } } ["previous":"Exception":private]=> NULL ["severity"]=> int(2) } object(DateTime)#2 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.002284" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "K" } object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.002485" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "L" } object(DateTime)#2 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.002695" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "M" } object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.002888" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "N" } object(DateTime)#2 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.003092" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "O" } object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.003284" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "P" } object(DateTime)#2 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.003485" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Q" } object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.003677" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "R" } object(DateTime)#2 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.003885" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "S" } object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.004076" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "T" } object(DateTime)#2 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.004282" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "U" } object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.004484" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "V" } object(DateTime)#2 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.004696" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "W" } object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.004889" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "X" } object(DateTime)#2 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.005090" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Y" } object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-29 17:24:47.005290" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Z" }

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page