3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $birthDate = new DateTime(null); $birthDateNotNull = new DateTime('1989-09-26'); $serializeBirthDate = serialize($birthDate); $serializeBirthDateNotNull = serialize($birthDateNotNull); echo $serializeBirthDate; echo PHP_EOL; echo $serializeBirthDateNotNull; echo PHP_EOL; echo PHP_EOL; echo PHP_EOL; echo unserialize($serializeBirthDate); echo PHP_EOL; echo unserialize($serializeBirthDateNotNull); echo PHP_EOL; echo "#######################"; echo PHP_EOL; $perSmsDate = new DateTime(null); $perSmsDateNotNull = new DateTime('2015-12-07 20:40:25'); $serializePerSmsDate = serialize($perSmsDate); $serializePerSmsDateNotNull = serialize($perSmsDateNotNull); echo $serializePerSmsDate; echo PHP_EOL; echo $serializePerSmsDateNotNull; echo PHP_EOL; echo PHP_EOL; echo PHP_EOL; echo unserialize($serializePerSmsDate); echo PHP_EOL; echo unserialize($serializePerSmsDateNotNull);
based on TASAL
Output for 7.3.0beta1
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.002009";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Recoverable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for 7.3.0alpha1
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.003310";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Recoverable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for 7.2.6
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.002877";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Recoverable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for 7.2.5
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.004923";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Recoverable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for 7.2.0
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.004889";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Recoverable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for 7.1.20
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.004126";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Recoverable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for 7.1.7
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.002900";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Recoverable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for 7.1.6
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.016552";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Recoverable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for 7.1.5
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.020957";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Recoverable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for 7.1.4
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.019986";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Recoverable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for 7.1.3
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Recoverable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for 7.1.2
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.019419";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Recoverable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for 7.1.1
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.004944";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Recoverable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for 7.1.0
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.006343";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Recoverable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.20
O:8:"DateTime":3:{s:4:"date";s:26:"2017-06-28 12:27:20.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} O:8:"DateTime":3:{s:4:"date";s:26:"1989-09-26 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:16:"Europe/Amsterdam";} Catchable fatal error: Object of class DateTime could not be converted to string in /in/QD2FD on line 17
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught exception 'Exception' with message '__construct() expects parameter 1 to be string, null given' in /in/QD2FD:3 Stack trace: #0 /in/QD2FD(3): DateTime->__construct() #1 {main}
Process exited with code 255.