3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php foreach (range('a', 'z') as $letter) { try { new DateTime($letter); echo "$letter SUCCESS\n"; } catch (Exception $e) { echo "$letter FAIL\n"; } }
Output for 5.2.4 - 7.1.0
a SUCCESS b SUCCESS c SUCCESS d SUCCESS e SUCCESS f SUCCESS g SUCCESS h SUCCESS i SUCCESS j FAIL k SUCCESS l SUCCESS m SUCCESS n SUCCESS o SUCCESS p SUCCESS q SUCCESS r SUCCESS s SUCCESS t SUCCESS u SUCCESS v SUCCESS w SUCCESS x SUCCESS y SUCCESS z SUCCESS
Output for 5.2.0 - 5.2.3
a FAIL b FAIL c FAIL d FAIL e FAIL f FAIL g FAIL h FAIL i FAIL j FAIL k FAIL l FAIL m FAIL n FAIL o FAIL p FAIL q FAIL r FAIL s FAIL t FAIL u FAIL v FAIL w FAIL x FAIL y FAIL z FAIL
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/AJNMk on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/AJNMk on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/AJNMk on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/AJNMk on line 4
Process exited with code 255.