3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = new ArrayObject;var_dump($obj);var_dump(serialize($obj));class MyArrayObject extends ArrayObject{public function __construct(){} public function serialize(){return "";} public function unserialize($data){echo 123;exit;}};$myObj = new MyArrayObject;var_dump($myObj);var_dump(serialize($myObj));$myUnserObj = unserialize("O:13:\"MyArrayObject\":0:{}");var_dump($myUnserObj);$myUnserObj->append(123);var_dump($myUnserObj);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Return type of MyArrayObject::unserialize($data) should either be compatible with ArrayObject::unserialize(string $data): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/rT5pJ on line 3 Deprecated: Return type of MyArrayObject::serialize() should either be compatible with ArrayObject::serialize(): string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/rT5pJ on line 3 object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } string(57) "O:11:"ArrayObject":4:{i:0;i:0;i:1;a:0:{}i:2;a:0:{}i:3;N;}" object(MyArrayObject)#2 (1) { ["storage":"ArrayObject":private]=> array(0) { } } string(59) "O:13:"MyArrayObject":4:{i:0;i:0;i:1;a:0:{}i:2;a:0:{}i:3;N;}" Fatal error: Uncaught UnexpectedValueException: Incomplete or ill-typed serialization data in /in/rT5pJ:3 Stack trace: #0 [internal function]: ArrayObject->__unserialize(Array) #1 /in/rT5pJ(3): unserialize('O:13:"MyArrayOb...') #2 {main} thrown in /in/rT5pJ on line 3
Process exited with code 255.

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:
52.23 ms | 402 KiB | 8 Q