3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $list = new SplDoublyLinkedList(); $list->push("a"); $list->push("b"); $ser = $list->serialize(); var_dump($ser); var_dump(SplDoublyLinkedList::unserialize($ser)); var_dump(unserialize($ser)); var_dump(unserialize($ser), $consumed); var_dump($consumed);
Output for 7.0.0 - 7.2.0
string(22) "i:0;:s:1:"a";:s:1:"b";" Fatal error: Uncaught Error: Non-static method SplDoublyLinkedList::unserialize() cannot be called statically in /in/ZVrSS:7 Stack trace: #0 {main} thrown in /in/ZVrSS on line 7
Process exited with code 255.
Output for 5.4.0 - 5.6.25
string(22) "i:0;:s:1:"a";:s:1:"b";" Fatal error: Non-static method SplDoublyLinkedList::unserialize() cannot be called statically in /in/ZVrSS on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Fatal error: Call to undefined method SplDoublyLinkedList::serialize() in /in/ZVrSS on line 5
Process exited with code 255.
Output for 5.0.0 - 5.2.17
Fatal error: Class 'SplDoublyLinkedList' not found in /in/ZVrSS on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: spldoublylinkedlist in /in/ZVrSS on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: spldoublylinkedlist in /in/ZVrSS on line 2