3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dt = new DateTime('now', new \DateTimeZone('UTC')); $serial = serialize($dt); var_dump( $serial );
based on dK1Ru
Output for 7.2.0
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:47.004447";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 7.1.10
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:47.004665";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 7.1.7
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:47.004976";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 7.1.6
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:47.011124";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 7.1.5
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:47.012777";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 7.1.0
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:47.004092";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.28, 7.0.20
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:47.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 7.0.6
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-05-03 16:35:56.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 7.0.5
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-03 05:00:42.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 7.0.4
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-03-10 17:47:57.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 7.0.3
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-03-18 18:57:08.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 7.0.2
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-03-23 01:05:17.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 7.0.1
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-03-24 04:43:12.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 7.0.0
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-03-27 05:39:11.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.21
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-05-02 11:45:02.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.20
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-10 03:59:54.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.19
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-03-08 01:59:27.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.18
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-03-15 10:43:27.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.17
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-03-19 22:22:27.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.16
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-03-28 06:26:25.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.15
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-03-29 07:17:07.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.14
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-02 09:08:04.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.13
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-15 13:32:48.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.12
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-20 04:02:04.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.11
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-24 10:25:17.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.10
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-25 12:27:39.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.9
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-27 17:37:30.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.6.8
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-30 02:29:36.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.5.35
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-05-22 19:11:59.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.5.34
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-11 06:11:54.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.5.33
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-03-09 04:43:49.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.5.32
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-03-17 14:39:01.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.5.31
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-03-21 01:24:43.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.5.30
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-01 09:11:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.5.29
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-17 03:56:04.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.5.28
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-21 07:16:04.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.5.27
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-22 09:02:12.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.5.26
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-26 15:10:22.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.5.25
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-04-28 22:05:51.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.5.24
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2016-05-24 04:34:49.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.4.44 - 5.4.45
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:49.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.4.43
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:50.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.4.41 - 5.4.42
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:51.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.4.40
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:52.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.4.37 - 5.4.39
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:53.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.4.34 - 5.4.36
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:54.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.4.31 - 5.4.32
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:55.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.4.30
string(114) "O:8:"DateTime":3:{s:4:"date";s:26:"2015-11-10 08:57:56.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.4.26 - 5.4.29
string(107) "O:8:"DateTime":3:{s:4:"date";s:19:"2015-11-10 08:57:56";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.3.28, 5.4.23 - 5.4.25
string(107) "O:8:"DateTime":3:{s:4:"date";s:19:"2015-11-10 08:57:57";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.4.19 - 5.4.22
string(107) "O:8:"DateTime":3:{s:4:"date";s:19:"2015-11-10 08:57:58";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.3.26 - 5.3.27, 5.4.15 - 5.4.18
string(107) "O:8:"DateTime":3:{s:4:"date";s:19:"2015-11-10 08:57:59";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.3.21 - 5.3.25, 5.4.11 - 5.4.14
string(107) "O:8:"DateTime":3:{s:4:"date";s:19:"2015-11-10 08:58:00";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.3.17 - 5.3.20, 5.4.6 - 5.4.10
string(107) "O:8:"DateTime":3:{s:4:"date";s:19:"2015-11-10 08:58:01";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.3.12 - 5.3.16, 5.4.3 - 5.4.5
string(107) "O:8:"DateTime":3:{s:4:"date";s:19:"2015-11-10 08:58:02";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.3.7 - 5.3.11, 5.4.0 - 5.4.2
string(107) "O:8:"DateTime":3:{s:4:"date";s:19:"2015-11-10 08:58:03";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.3.29
string(107) "O:8:"DateTime":3:{s:4:"date";s:19:"2015-11-10 08:57:55";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.3.2 - 5.3.6
string(107) "O:8:"DateTime":3:{s:4:"date";s:19:"2015-11-10 08:58:04";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.3.0 - 5.3.1
string(107) "O:8:"DateTime":3:{s:4:"date";s:19:"2015-11-10 08:58:05";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}"
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/R6mu5 on line 3 string(19) "O:8:"DateTime":0:{}"
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/R6mu5 on line 3 Fatal error: Class 'DateTime' not found in /in/R6mu5 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/R6mu5 on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/R6mu5 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/R6mu5 on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/R6mu5 on line 3