3v4l.org

run code in 300+ PHP versions simultaneously
<?php $class = 'DateTime'; var_dump(unserialize(sprintf( 'O:%d:"%s":0:{}', strlen($class), $class )));
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Invalid serialization data for DateTime object in /in/oC6PR:4 Stack trace: #0 [internal function]: DateTime->__unserialize(Array) #1 /in/oC6PR(4): unserialize('O:8:"DateTime":...') #2 {main} thrown in /in/oC6PR on line 4
Process exited with code 255.
Output for 7.1.5 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
Fatal error: Uncaught Error: Invalid serialization data for DateTime object in /in/oC6PR:7 Stack trace: #0 [internal function]: DateTime->__wakeup() #1 /in/oC6PR(7): unserialize('O:8:"DateTime":...') #2 {main} thrown in /in/oC6PR on line 7
Process exited with code 255.
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.20
Fatal error: Invalid serialization data for DateTime object in /in/oC6PR on line 7
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.4.45, 5.5.24 - 5.5.35, 5.6.8 - 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.2.17, 5.3.0 - 5.3.23, 5.4.0 - 5.4.13
object(DateTime)#1 (0) { }
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
object(__PHP_Incomplete_Class)#1 (1) { ["__PHP_Incomplete_Class_Name"]=> string(8) "DateTime" }
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9
object(__PHP_Incomplete_Class)(1) { ["__PHP_Incomplete_Class_Name"]=> string(8) "datetime" }

preferences:
192.15 ms | 402 KiB | 356 Q