3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo implements JsonSerializable { private $een; private $twee; public function __construct(string $een, int $twee = null) { $this->een = $een; $this->twee = $twee; } public function getEen(): string { return $this->een; } public function getTwee(): int { return $this->twee; } public function jsonSerialize(): array { return [$this->een, $this->twee]; } } $first = new Foo('thestring'); $storage = json_encode($first); var_dump($storage); $second = new Foo(...json_decode($storage, true)); var_dump($second);
Output for git.master, git.master_jit, rfc.property-hooks
string(18) "["thestring",null]" object(Foo)#2 (2) { ["een":"Foo":private]=> string(9) "thestring" ["twee":"Foo":private]=> NULL }

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:
56.21 ms | 401 KiB | 8 Q