3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Json { public function toJSON() { return json_encode(get_object_vars($this)); } } class A extends Json { private $a; function __construct($input = null) { $this->a = $input; } //getter & setter } class B extends Json { private $b; function __construct($input = null) { $this->b = $input; } //getter & setter } $a = (new A("A"))->toJSON(); var_dump($a);
Output for git.master_jit, git.master, rfc.property-hooks
string(2) "[]"

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:
163.06 ms | 405 KiB | 5 Q