3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { function __wakeup() { print "In __wakeup\n"; } } session_start(); session_decode('core|a:4:{s:23:"_session_validator_data";a:4:{s:11:"remote_addr";s:9:"127.0.0.1";s:8:"http_via";s:0:"";s:20:"http_x_forwarded_for";s:0:"";s:15:"http_user_agent";s:22:"}}test|a:1:{i:0;i:23;}";}s:8:"messages";O:34:"Mage_Core_Model_Message_Collection":2:{s:12:"*_messages";a:0:{}s:20:"*_lastAddedMessage";N;}s:12:"visitor_data";a:15:{s:0:"";N;s:11:"server_addr";s:4:"1234";s:11:"remote_addr";s:4:"1234";s:11:"http_secure";b:0;s:9:"http_host";s:9:"localhost";s:15:"http_user_agent";s:22:"}}test|a:1:{i:0;i:23;}";s:20:"http_accept_language";s:0:"";s:19:"http_accept_charset";s:0:"";s:11:"request_uri";s:9:"/magento/";s:10:"session_id";s:6:"xxxxxx";s:12:"http_referer";s:0:"";s:14:"first_visit_at";s:19:"2015-12-18 15:01:24";s:14:"is_new_visitor";b:0;s:13:"last_visit_at";s:19:"2015-12-18 15:01:30";s:10:"visitor_id";s:3:"227";}s:8:"last_url";s:41:"http://localhost/magento/cms/index/index/";}customer_base|a:3:{s:23:"_session_validator_data";a:4:{s:11:"remote_addr";s:9:"127.0.0.1";s:8:"http_via";s:0:"";s:20:"http_x_forwarded_for";s:0:"";s:15:"http_user_agent";s:22:"}}test|a:1:{i:0;i:23;}";}s:8:"messages";O:34:"Mage_Core_Model_Message_Collection":2:{s:12:"*_messages";a:0:{}s:20:"*_lastAddedMessage";N;}s:19:"wishlist_item_count";i:0;}checkout|a:2:{s:23:"_session_validator_data";a:4:{s:11:"remote_addr";s:9:"127.0.0.1";s:8:"http_via";s:0:"";s:20:"http_x_forwarded_for";s:0:"";s:15:"http_user_agent";s:22:"}}test|a:1:{i:0;i:23;}";}s:8:"messages";O:34:"Mage_Core_Model_Message_Collection":2:{s:12:"*_messages";a:0:{}s:20:"*_lastAddedMessage";N;}}catalog|a:2:{s:23:"_session_validator_data";a:4:{s:11:"remote_addr";s:9:"127.0.0.1";s:8:"http_via";s:0:"";s:20:"http_x_forwarded_for";s:0:"";s:15:"http_user_agent";s:22:"}}test|a:1:{i:0;i:23;}";}s:8:"messages";O:34:"Mage_Core_Model_Message_Collection":2:{s:12:"*_messages";a:0:{}s:20:"*_lastAddedMessage";N;}}store_default|a:1:{s:23:"_session_validator_data";a:4:{s:11:"remote_addr";s:9:"127.0.0.1";s:8:"http_via";s:0:"";s:20:"http_x_forwarded_for";s:0:"";s:15:"http_user_agent";s:22:"}}test|a:1:{i:0;i:23;}";}}store_french|a:1:{s:23:"_session_validator_data";a:4:{s:11:"remote_addr";s:9:"127.0.0.1";s:8:"http_via";s:0:"";s:20:"http_x_forwarded_for";s:0:"";s:15:"http_user_agent";s:22:"}}test|a:1:{i:0;i:23;}";}}store_german|a:1:{s:23:"_session_validator_data";a:4:{s:11:"remote_addr";s:9:"127.0.0.1";s:8:"http_via";s:0:"";s:20:"http_x_forwarded_for";s:0:"";s:15:"http_user_agent";s:22:"}}test|a:1:{i:0;i:23;}";}}'); var_dump($_SESSION, serialize(new Test));
Output for 5.5.29 - 5.5.35, 5.6.13 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Warning: session_decode(): Failed to decode session object. Session has been destroyed in /in/JqaAC on line 12 array(0) { } string(15) "O:4:"Test":0:{}"
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 Warning: session_decode(): Failed to decode session object. Session has been destroyed in /in/JqaAC on line 12 array(0) { } string(15) "O:4:"Test":0:{}"
Output for 5.5.24 - 5.5.28, 5.6.8 - 5.6.12
array(8) { ["core"]=> NULL ["a:0:{}s:20:"*_lastAddedMessage";N;}s:12:"visitor_data";a:15:{s:0:"";N;s:11:"server_addr";s:4:"1234";s:11:"remote_addr";s:4:"1234";s:11:"http_secure";b:0;s:9:"http_host";s:9:"localhost";s:15:"http_user_agent";s:22:"}}test"]=> array(1) { [0]=> int(23) } ["";s:20:"http_accept_language";s:0:"";s:19:"http_accept_charset";s:0:"";s:11:"request_uri";s:9:"/magento/";s:10:"session_id";s:6:"xxxxxx";s:12:"http_referer";s:0:"";s:14:"first_visit_at";s:19:"2015-12-18 15:01:24";s:14:"is_new_visitor";b:0;s:13:"last_visit_at";s:19:"2015-12-18 15:01:30";s:10:"visitor_id";s:3:"227";}s:8:"last_url";s:41:"http://localhost/magento/cms/index/index/";}customer_base"]=> NULL ["a:0:{}s:20:"*_lastAddedMessage";N;}s:19:"wishlist_item_count";i:0;}checkout"]=> NULL ["a:0:{}s:20:"*_lastAddedMessage";N;}}catalog"]=> NULL ["a:0:{}s:20:"*_lastAddedMessage";N;}}store_default"]=> array(1) { ["_session_validator_data"]=> array(4) { ["remote_addr"]=> string(9) "127.0.0.1" ["http_via"]=> string(0) "" ["http_x_forwarded_for"]=> string(0) "" ["http_user_agent"]=> string(22) "}}test|a:1:{i:0;i:23;}" } } ["store_french"]=> array(1) { ["_session_validator_data"]=> array(4) { ["remote_addr"]=> string(9) "127.0.0.1" ["http_via"]=> string(0) "" ["http_x_forwarded_for"]=> string(0) "" ["http_user_agent"]=> string(22) "}}test|a:1:{i:0;i:23;}" } } ["store_german"]=> array(1) { ["_session_validator_data"]=> array(4) { ["remote_addr"]=> string(9) "127.0.0.1" ["http_via"]=> string(0) "" ["http_x_forwarded_for"]=> string(0) "" ["http_user_agent"]=> string(22) "}}test|a:1:{i:0;i:23;}" } } } string(15) "O:4:"Test":0:{}"

preferences:
139.36 ms | 405 KiB | 183 Q