3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = new DateTimeImmutable(); $b = new DateTimeImmutable('yesterday'); $c = array($a, $b); $d = max($c); var_dump($d);
based on sge59
Output for 7.2.0
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2014-10-06 12:28:04.002660" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2014-10-06 12:28:04.004367" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2014-10-06 12:28:04.002555" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2014-10-06 12:28:04.013097" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2014-10-06 12:28:04.012571" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2014-10-06 12:28:04.004019" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28, 7.0.14 - 7.0.20
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2014-10-06 12:28:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-05-03 05:55:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.5
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-02 18:59:37.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-10 04:57:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.3
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-18 05:20:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.2
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-21 15:47:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.1
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-23 16:23:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.0
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-26 18:08:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-05-02 01:10:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-09 14:16:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.19
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-07 05:02:42.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.18
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-14 18:00:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.17
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-19 09:43:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.16
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-27 19:54:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.15
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-28 20:47:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.14
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-01 23:17:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.13
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-15 03:19:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.12
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-19 16:49:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-22 23:43:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.10
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-25 01:37:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-27 06:37:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.8
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-29 14:28:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.7
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-05-25 04:39:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-05-22 04:47:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-10 20:13:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.33
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-08 15:53:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-16 21:50:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.31
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-20 12:33:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-03-31 22:48:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.29
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-16 17:25:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-20 19:51:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.27
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-21 22:09:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.26
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-26 04:00:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.25
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-04-28 09:58:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2016-05-23 16:57:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.0.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/Kgo9A on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetimeimmutable in /in/Kgo9A on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetimeimmutable in /in/Kgo9A on line 3