3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ToS{function __toString(){die("hi");}} //$e=new exception; $e=unserialize('O:9:"Exception":1:{s:19:"'."\0".'Exception'."\0".'previous";O:3:"ToS":0:{}}'); echo $e;
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught TypeError: Cannot assign ToS to property Exception::$previous of type ?Throwable in /in/7uU45:4 Stack trace: #0 /in/7uU45(4): unserialize('O:9:"Exception"...') #1 {main} thrown in /in/7uU45 on line 4
Process exited with code 255.
Output for 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined property: Exception::$previous in /in/7uU45 on line 5 Notice: Undefined property: Exception::$previous in /in/7uU45 on line 5 Exception in /in/7uU45:4 Stack trace: #0 /in/7uU45(4): unserialize('O:9:"Exception"...') #1 {main}
Output for 7.0.0 - 7.0.6, 7.3.32 - 7.3.33
Exception in /in/7uU45:4 Stack trace: #0 /in/7uU45(4): unserialize('O:9:"Exception"...') #1 {main}
Output for 5.4.44 - 5.4.45, 5.5.28 - 5.5.35, 5.6.12 - 5.6.28
exception 'Exception' in /in/7uU45:4 Stack trace: #0 /in/7uU45(4): unserialize('O:9:"Exception"...') #1 {main}
Output for 5.4.2 - 5.4.43, 5.5.24 - 5.5.27, 5.6.7 - 5.6.11
Notice: Undefined property: ToS::$message in /in/7uU45 on line 5 Notice: Undefined property: ToS::$file in /in/7uU45 on line 5 Notice: Undefined property: ToS::$line in /in/7uU45 on line 5
Process exited with code 139.

preferences:
218.88 ms | 402 KiB | 227 Q