3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! class Example { public $publicSetting = 'public'; protected $protectedSetting = 'protected'; private $privateSetting = 'private'; public function showEverything() { return get_object_vars($this); } public function showMyPublicsOnly() { $analyse = function($object) { return get_object_vars($object); }; return $analyse($this); } } $example = new Example(); var_dump(get_object_vars($example)); var_dump($example->showEverything()); var_dump($example->showMyPublicsOnly());
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { ["publicSetting"]=> string(6) "public" } array(3) { ["publicSetting"]=> string(6) "public" ["protectedSetting"]=> string(9) "protected" ["privateSetting"]=> string(7) "private" } array(3) { ["publicSetting"]=> string(6) "public" ["protectedSetting"]=> string(9) "protected" ["privateSetting"]=> string(7) "private" }

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