3v4l.org

run code in 300+ PHP versions simultaneously
<?php $user = new stdClass(); $user->id = 1; $user->name = 'John Doe'; class Herman { private $milk; public function setMilk($flag) { $this->milk = $flag; } } $hermit = new Herman(); $hermit->setMilk(true); $user->hermit = $hermit; $foobar = array('foo' => 'bar', 'user' => $user); $serialized = serialize($foobar); echo "Serialized: ${serialized}"; var_dump(unserialize($serialized));
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/IrSkI on line 24 Serialized: a:2:{s:3:"foo";s:3:"bar";s:4:"user";O:8:"stdClass":3:{s:2:"id";i:1;s:4:"name";s:8:"John Doe";s:6:"hermit";O:6:"Herman":1:{s:12:"Hermanmilk";b:1;}}}array(2) { ["foo"]=> string(3) "bar" ["user"]=> object(stdClass)#3 (3) { ["id"]=> int(1) ["name"]=> string(8) "John Doe" ["hermit"]=> object(Herman)#4 (1) { ["milk":"Herman":private]=> bool(true) } } }

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