3v4l.org

run code in 150+ 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.1.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 hhvm-3.12.0
string(48) "a:2:{i:0;a:2:{i:0;s:1:"a";i:1;s:1:"b";}i:1;i:0;}" Fatal error: Uncaught Error: $this is null in /in/ZVrSS:7 Stack trace: #0 /in/ZVrSS(7): SplDoublyLinkedList::unserialize() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0
string(48) "a:2:{i:0;a:2:{i:0;s:1:"a";i:1;s:1:"b";}i:1;i:0;}" Fatal error: $this is null in /in/ZVrSS on line -1
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