3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CantUnserializeThis extends ArrayObject { } $className = 'CantUnserializeThis'; $serialized = serialize(new ArrayObject()); $chunks = explode(':', $serialized); $serializedValuesChunk = array_slice($chunks, 3); var_dump($serializedValuesChunk); var_dump(unserialize(sprintf( 'C:%d:"%s":0:{}', strlen($className), $className ))); var_dump(unserialize(sprintf( 'S:%d:"%s":0:{}', strlen($className), $className )));
Output for git.master, git.master_jit
array(11) { [0]=> string(1) "4" [1]=> string(2) "{i" [2]=> string(3) "0;i" [3]=> string(3) "0;i" [4]=> string(3) "1;a" [5]=> string(1) "0" [6]=> string(3) "{}i" [7]=> string(3) "2;a" [8]=> string(1) "0" [9]=> string(3) "{}i" [10]=> string(5) "3;N;}" } object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Notice: unserialize(): Error at offset 26 of 31 bytes in /in/WkqUm on line 21 bool(false)
Output for rfc.property-hooks
array(11) { [0]=> string(1) "4" [1]=> string(2) "{i" [2]=> string(3) "0;i" [3]=> string(3) "0;i" [4]=> string(3) "1;a" [5]=> string(1) "0" [6]=> string(3) "{}i" [7]=> string(3) "2;a" [8]=> string(1) "0" [9]=> string(3) "{}i" [10]=> string(5) "3;N;}" } object(CantUnserializeThis)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } Warning: unserialize(): Error at offset 26 of 31 bytes in /in/WkqUm on line 21 bool(false)

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