3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ClassWithWakeup { public function __wakeup() { echo "ClassWithWakeup::__wakeup\n"; throw new Exception("exception thrown by __wakeup"); } } function __autoload($className) { echo "__autoload :: $className\n"; throw new Exception("exception thrown by __autoload"); } $params = 'a:2:{i:0;O:15:"ClassWithWakeup":0:{}i:1;O:7:"Unknown":0:{}}'; try { $result = unserialize($params); echo "try - after unserialize\n"; } catch (Exception $e) { echo "exception caught, ok\n"; }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: __autoload() is no longer supported, use spl_autoload_register() instead in /in/sfHcQ on line 9
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.12 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /in/sfHcQ on line 9 __autoload :: Unknown exception caught, ok
Output for 7.0.20, 7.1.5 - 7.1.20, 7.3.32 - 7.3.33, 7.4.26
__autoload :: Unknown exception caught, ok
Output for 5.4.14 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.14, 7.1.0
ClassWithWakeup::__wakeup exception caught, ok
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.13
ClassWithWakeup::__wakeup __autoload :: Unknown Fatal error: Uncaught exception 'Exception' with message 'exception thrown by __wakeup' in /in/sfHcQ:5 Stack trace: #0 [internal function]: ClassWithWakeup->__wakeup() #1 /in/sfHcQ(18): unserialize('a:2:{i:0;O:15:"...') #2 {main} Next exception 'Exception' with message 'exception thrown by __autoload' in /in/sfHcQ:11 Stack trace: #0 /in/sfHcQ(0): __autoload('Unknown') #1 {main} thrown in /in/sfHcQ on line 11
Process exited with code 255.
Output for 5.0.1 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
ClassWithWakeup::__wakeup __autoload :: Unknown Fatal error: Function __autoload(Unknown) threw an exception of type 'Exception' in /in/sfHcQ on line 24
Process exited with code 255.
Output for 5.0.0
ClassWithWakeup::__wakeup __autoload :: Unknown Fatal error: __autoload(Unknown) threw an exception of type 'Exception' in /in/sfHcQ on line 24
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/sfHcQ on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/sfHcQ on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/sfHcQ on line 3
Process exited with code 255.

preferences:
220.99 ms | 401 KiB | 311 Q