3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php foreach (range('a', 'z') as $letter) { try { $dt = new DateTime($letter); echo "$letter SUCCESS {$dt->format("r")}\n"; } catch (Exception $e) { echo "$letter FAIL\n"; } }
Output for 5.2.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
a SUCCESS Tue, 24 Sep 2013 10:05:54 +0100 b SUCCESS Tue, 24 Sep 2013 10:05:54 +0200 c SUCCESS Tue, 24 Sep 2013 10:05:54 +0300 d SUCCESS Tue, 24 Sep 2013 10:05:54 +0400 e SUCCESS Tue, 24 Sep 2013 10:05:54 +0500 f SUCCESS Tue, 24 Sep 2013 10:05:54 +0600 g SUCCESS Tue, 24 Sep 2013 10:05:54 +0700 h SUCCESS Tue, 24 Sep 2013 10:05:54 +0800 i SUCCESS Tue, 24 Sep 2013 10:05:54 +0900 j FAIL k SUCCESS Tue, 24 Sep 2013 10:05:54 +1000 l SUCCESS Tue, 24 Sep 2013 10:05:54 +1100 m SUCCESS Tue, 24 Sep 2013 10:05:54 +1200 n SUCCESS Tue, 24 Sep 2013 10:05:54 -0100 o SUCCESS Tue, 24 Sep 2013 10:05:54 -0200 p SUCCESS Tue, 24 Sep 2013 10:05:54 -0300 q SUCCESS Tue, 24 Sep 2013 10:05:54 -0400 r SUCCESS Tue, 24 Sep 2013 10:05:54 -0500 s SUCCESS Tue, 24 Sep 2013 10:05:54 -0600 t SUCCESS Tue, 24 Sep 2013 10:05:54 -0700 u SUCCESS Tue, 24 Sep 2013 10:05:54 -0800 v SUCCESS Tue, 24 Sep 2013 10:05:54 -0900 w SUCCESS Tue, 24 Sep 2013 10:05:54 -1000 x SUCCESS Tue, 24 Sep 2013 10:05:54 -1100 y SUCCESS Tue, 24 Sep 2013 10:05:54 -1200 z SUCCESS Tue, 24 Sep 2013 10:05:54 +0000
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/mvTIV on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/mvTIV 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/mvTIV on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/mvTIV on line 4
Process exited with code 255.