3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $class = 'DateTime'; var_dump(unserialize(sprintf( 'O:%d:"%s":0:{}', strlen($class), $class )));
Output for 7.1.0
Fatal error: Uncaught Error: Invalid serialization data for DateTime object in /in/oC6PR:6 Stack trace: #0 [internal function]: DateTime->__wakeup() #1 /in/oC6PR(6): unserialize('O:8:"DateTime":...') #2 {main} thrown in /in/oC6PR on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Fatal error: Invalid serialization data for DateTime object in /in/oC6PR on line 6
Process exited with code 255.
Output for 5.3.24 - 5.3.29, 5.4.14 - 5.6.28
Fatal error: Invalid serialization data for DateTime object in /in/oC6PR on line 8
Process exited with code 255.
Output for 5.2.0 - 5.3.23, 5.4.0 - 5.4.13
object(DateTime)#1 (0) { }
Output for 5.0.0 - 5.1.6
object(__PHP_Incomplete_Class)#1 (1) { ["__PHP_Incomplete_Class_Name"]=> string(8) "DateTime" }
Output for 4.3.0 - 4.4.9
object(__PHP_Incomplete_Class)(1) { ["__PHP_Incomplete_Class_Name"]=> string(8) "datetime" }