3v4l.org

run code in 300+ PHP versions simultaneously
<?php class social_button { private function social_facebook() { return 'Facebook'; } private function social_instagram() { return 'Instagram'; } private function social_twitter() { return 'Twitter'; } public function all() { $reflection = new \ReflectionObject($this); $prefix = 'social_'; $methods = array_filter($reflection->getMethods(), function (\ReflectionMethod $method) use ($prefix) { return 0 === strpos($method->getName(), $prefix); }); $results = array_map(function (\ReflectionMethod $method) { $name = $method->getName(); return $this->$name(); }, $methods); return $results; } } $button = new social_button(); var_dump($button->all());
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> string(8) "Facebook" [1]=> string(9) "Instagram" [2]=> string(7) "Twitter" }

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