3v4l.org

run code in 300+ PHP versions simultaneously
<?php $class = 'Generator'; 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 Exception: Unserialization of 'Generator' is not allowed in /in/EboRt:4 Stack trace: #0 /in/EboRt(4): unserialize('O:9:"Generator"...') #1 {main} thrown in /in/EboRt on line 4
Process exited with code 255.
Output for 8.1.0 - 8.1.28
Fatal error: Uncaught Exception: Unserialization of 'Generator' is not allowed in /in/EboRt:7 Stack trace: #0 /in/EboRt(7): unserialize('O:9:"Generator"...') #1 {main} thrown in /in/EboRt on line 7
Process exited with code 255.
Output for 7.0.20, 7.1.5 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
Warning: Erroneous data format for unserializing 'Generator' in /in/EboRt on line 7 Notice: unserialize(): Error at offset 19 of 20 bytes in /in/EboRt on line 7 bool(false)
Output for 7.3.32 - 7.3.33
Warning: Erroneous data format for unserializing 'Generator' in /in/EboRt on line 7 bool(false)
Output for 7.0.0 - 7.0.14, 7.1.0
Warning: Erroneous data format for unserializing 'Generator' in /in/EboRt on line 6 Notice: unserialize(): Error at offset 19 of 20 bytes in /in/EboRt on line 6 bool(false)
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Warning: Erroneous data format for unserializing 'Generator' in /in/EboRt on line 8 Notice: unserialize(): Error at offset 19 of 20 bytes in /in/EboRt on line 8 bool(false)
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45
object(__PHP_Incomplete_Class)#1 (1) { ["__PHP_Incomplete_Class_Name"]=> string(9) "Generator" }
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9
object(__PHP_Incomplete_Class)(1) { ["__PHP_Incomplete_Class_Name"]=> string(9) "generator" }

preferences:
258 ms | 402 KiB | 356 Q