3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { function __construct() { echo 'hi'; } } //$obj = new ReflectionFunction('phpinfo'); //var_dump(serialize($obj)); $str = 'O:18:"ReflectionFunction":1:{s:4:"info";a:14:{s:4:"name";s:7:"phpinfo";s:7:"closure";s:0:"";s:8:"internal";b:1;s:11:"return_type";b:0;s:3:"doc";b:0;s:6:"params";a:1:{i:0;a:9:{s:5:"index";i:0;s:4:"name";s:4:"what";s:4:"type";s:0:"";s:9:"type_hint";s:0:"";s:8:"function";s:7:"phpinfo";s:8:"nullable";b:1;s:7:"default";i:0;s:11:"defaultText";s:1:"0";s:10:"attributes";a:0:{}}}s:16:"static_variables";a:0:{}s:10:"attributes";a:0:{}s:8:"is_async";b:0;s:10:"is_closure";b:0;s:12:"is_generator";b:0;s:4:"file";s:2:"//";s:5:"line1";i:0;s:5:"line2";i:0;}}'; unserialize($str);
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Exception: Unserialization of 'ReflectionFunction' is not allowed in /in/LT5Ov:12 Stack trace: #0 /in/LT5Ov(12): unserialize('O:18:"Reflectio...') #1 {main} thrown in /in/LT5Ov on line 12
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught Exception: Unserialization of 'ReflectionFunction' is not allowed in /in/LT5Ov:12 Stack trace: #0 /in/LT5Ov(12): unserialize('O:18:"Reflectio...') #1 {main} thrown in /in/LT5Ov on line 12
Process exited with code 255.
Output for 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
Warning: Erroneous data format for unserializing 'ReflectionFunction' in /in/LT5Ov on line 12 Notice: unserialize(): Error at offset 29 of 546 bytes in /in/LT5Ov on line 12
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 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, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.5 - 7.2.33, 7.3.16 - 7.3.33

preferences:
236.71 ms | 404 KiB | 311 Q