3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $a_private = 1; protected $a_protected = 2; public $a_public = 3; } class C extends A { private $c_private = 1; protected $c_protected = 2; public $c_public = 3; } class B extends A { private $b_private = 1; protected $b_protected = 2; public $b_public = 3; protected $sub; function __construct(){ $this->sub = new C(); } function __debugInfo(){ return ['foo'=>'bar']; } } function object_dump($object){ return (array)$object; } var_dump(object_dump(new B));
Output for git.master, git.master_jit, rfc.property-hooks
array(7) { ["Aa_private"]=> int(1) ["*a_protected"]=> int(2) ["a_public"]=> int(3) ["Bb_private"]=> int(1) ["*b_protected"]=> int(2) ["b_public"]=> int(3) ["*sub"]=> object(C)#2 (6) { ["a_private":"A":private]=> int(1) ["a_protected":protected]=> int(2) ["a_public"]=> int(3) ["c_private":"C":private]=> int(1) ["c_protected":protected]=> int(2) ["c_public"]=> int(3) } }

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