3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected string $city = "CityB"; private string $name = "NameA"; public function getDataA() { return [ $this->city, $this->name ]; } } class B extends A { public string $city = "CityB"; public string $name = "NameB"; public function getDataB() { return [ $this->city, $this->name ]; } } $c = new B; var_dump($c, $c->getDataA(), $c->getDataB());
Output for git.master, git.master_jit, rfc.property-hooks
object(B)#1 (3) { ["city"]=> string(5) "CityB" ["name":"A":private]=> string(5) "NameA" ["name"]=> string(5) "NameB" } array(2) { [0]=> string(5) "CityB" [1]=> string(5) "NameA" } array(2) { [0]=> string(5) "CityB" [1]=> string(5) "NameB" }

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:
48.49 ms | 406 KiB | 5 Q