3v4l.org

run code in 300+ PHP versions simultaneously
<?php class RefMef { private $_; public function __construct($ref) { $this->_ = $ref; } } class RoleStorage extends SPLObjectStorage { private $membres; public function serialize() { return parent::serialize(); } public function unserialize($serialized) { var_dump($serialized); parent::unserialize($serialized); } } $obj1 = new RefMef(1); $obj2 = new RefMef($obj1); $test = new RoleStorage; // $test->attach($obj2); // $test->attach($obj1); // $test->attach($test); echo $ser = serialize($test), "\n"; $try = unserialize($ser); // $test = unserialize('C:11:"RoleStorage":23:{x:i:1;N;,r:13;;m:a:0:{}}');
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Return type of RoleStorage::unserialize($serialized) should either be compatible with SplObjectStorage::unserialize(string $data): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/jNLZM on line 18 Deprecated: Return type of RoleStorage::serialize() should either be compatible with SplObjectStorage::serialize(): string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/jNLZM on line 15 O:11:"RoleStorage":2:{i:0;a:0:{}i:1;a:1:{s:20:"RoleStoragemembres";N;}}

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