3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $class = 'PDO'; var_dump(unserialize(sprintf( 'O:%d:"%s":0:{}', strlen($class), $class )));
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught PDOException: You cannot serialize or unserialize PDO instances in /in/6Sgjt:6 Stack trace: #0 [internal function]: PDO->__wakeup() #1 /in/6Sgjt(6): unserialize('O:3:"PDO":0:{}') #2 {main} thrown in /in/6Sgjt on line 6
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Notice: Unable to unserialize: [O:3:"PDO":0:{}]. A null object pointer was used.. in /in/6Sgjt on line 8 bool(false)
Output for 5.1.0 - 5.6.28
Fatal error: Uncaught exception 'PDOException' with message 'You cannot serialize or unserialize PDO instances' in /in/6Sgjt:8 Stack trace: #0 [internal function]: PDO->__wakeup() #1 /in/6Sgjt(8): unserialize('O:3:"PDO":0:{}') #2 {main} thrown in /in/6Sgjt on line 8
Process exited with code 255.
Output for 5.0.0 - 5.0.5
object(__PHP_Incomplete_Class)#1 (1) { ["__PHP_Incomplete_Class_Name"]=> string(3) "PDO" }
Output for 4.3.0 - 4.4.9
object(__PHP_Incomplete_Class)(1) { ["__PHP_Incomplete_Class_Name"]=> string(3) "pdo" }