3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $ar = [ new DateTime('2013-02-27T19:35:32Z'), new DateTime('2013-02-25T19:35:32Z'), ]; sort($ar); var_dump($ar);
Output for 5.4.30 - 7.1.0
array(2) { [0]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2013-02-25 19:35:32.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Z" } [1]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2013-02-27 19:35:32.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Z" } }
Output for 5.4.0 - 5.4.29
array(2) { [0]=> object(DateTime)#2 (3) { ["date"]=> string(19) "2013-02-25 19:35:32" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Z" } [1]=> object(DateTime)#1 (3) { ["date"]=> string(19) "2013-02-27 19:35:32" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "Z" } }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/tZGPv on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/tZGPv on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/tZGPv on line 3
Process exited with code 255.