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());

preferences:
41.07 ms | 402 KiB | 5 Q