3v4l.org

run code in 300+ PHP versions simultaneously
<?php # base class class Test_TestClassBase { public $x = 4; public function __wakeup() { var_dump("__wakeup"); } public function __sleep() { var_dump("__sleep"); return array_keys(get_object_vars($this)); } public function unserialize($input) { var_dump("unserialize"); } public function serialize() { var_dump("serialize"); return serialize(get_object_vars($this)); } } # derived classes class Test_TestClassA extends Test_TestClassBase {} class Test_TestClassB extends Test_TestClassBase implements Serializable {} class Test_TestClassAA extends Test_TestClassA implements Serializable {} class Test_TestClassBB extends Test_TestClassB {} # run our serialisation foreach(array("Test_TestClassA", "Test_TestClassB", "Test_TestClassAA", "Test_TestClassBB") as $class) { $serialised = 'O:'.strlen($class).':"'.$class.'":1:{s:1:"x";i:4;}'; var_dump("(input) ".$serialised); var_dump("(output) ".(unserialize($serialised) instanceof $class ? "true (passing)" : "false (failing)")); }
Output for git.master, git.master_jit
Deprecated: Test_TestClassB implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /in/XRr5t on line 37 Deprecated: Test_TestClassAA implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /in/XRr5t on line 38 Deprecated: Test_TestClassBB implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /in/XRr5t on line 39 string(48) "(input) O:15:"Test_TestClassA":1:{s:1:"x";i:4;}" string(8) "__wakeup" string(23) "(output) true (passing)" string(48) "(input) O:15:"Test_TestClassB":1:{s:1:"x";i:4;}" Warning: Erroneous data format for unserializing 'Test_TestClassB' in /in/XRr5t on line 48 Notice: unserialize(): Error at offset 26 of 39 bytes in /in/XRr5t on line 48 string(24) "(output) false (failing)" string(49) "(input) O:16:"Test_TestClassAA":1:{s:1:"x";i:4;}" Warning: Erroneous data format for unserializing 'Test_TestClassAA' in /in/XRr5t on line 48 Notice: unserialize(): Error at offset 27 of 40 bytes in /in/XRr5t on line 48 string(24) "(output) false (failing)" string(49) "(input) O:16:"Test_TestClassBB":1:{s:1:"x";i:4;}" Warning: Erroneous data format for unserializing 'Test_TestClassBB' in /in/XRr5t on line 48 Notice: unserialize(): Error at offset 27 of 40 bytes in /in/XRr5t on line 48 string(24) "(output) false (failing)"
Output for rfc.property-hooks
Deprecated: Test_TestClassB implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /in/XRr5t on line 37 Deprecated: Test_TestClassAA implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /in/XRr5t on line 38 Deprecated: Test_TestClassBB implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /in/XRr5t on line 39 string(48) "(input) O:15:"Test_TestClassA":1:{s:1:"x";i:4;}" string(8) "__wakeup" string(23) "(output) true (passing)" string(48) "(input) O:15:"Test_TestClassB":1:{s:1:"x";i:4;}" Warning: Erroneous data format for unserializing 'Test_TestClassB' in /in/XRr5t on line 48 Warning: unserialize(): Error at offset 26 of 39 bytes in /in/XRr5t on line 48 string(24) "(output) false (failing)" string(49) "(input) O:16:"Test_TestClassAA":1:{s:1:"x";i:4;}" Warning: Erroneous data format for unserializing 'Test_TestClassAA' in /in/XRr5t on line 48 Warning: unserialize(): Error at offset 27 of 40 bytes in /in/XRr5t on line 48 string(24) "(output) false (failing)" string(49) "(input) O:16:"Test_TestClassBB":1:{s:1:"x";i:4;}" Warning: Erroneous data format for unserializing 'Test_TestClassBB' in /in/XRr5t on line 48 Warning: unserialize(): Error at offset 27 of 40 bytes in /in/XRr5t on line 48 string(24) "(output) false (failing)"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
67.57 ms | 405 KiB | 8 Q