3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * BAR */ class Bar { /** * BAR::$prop */ protected $prop; /** * BAR::method() */ protected function method() { } } /** * FOO */ class Foo extends Bar { /** * FOO::$prop */ protected $prop; /** * FOO::method() */ protected function method() { } } echo "Class:\n"; $reflectionClass = new \ReflectionClass('Foo'); var_dump($reflectionClass->getDocComment()); $reflectionClass = new \ReflectionClass('Bar'); var_dump($reflectionClass->getDocComment()); echo "Property:\n"; $reflectionClass = new \ReflectionProperty('Foo', 'prop'); var_dump($reflectionClass->getDocComment()); $reflectionClass = new \ReflectionProperty('Bar', 'prop'); var_dump($reflectionClass->getDocComment()); echo "Method:\n"; $reflectionClass = new \ReflectionMethod('Foo', 'method'); var_dump($reflectionClass->getDocComment()); $reflectionClass = new \ReflectionMethod('Bar', 'method'); var_dump($reflectionClass->getDocComment());
Output for git.master, git.master_jit, rfc.property-hooks
Class: string(14) "/** * FOO */" string(14) "/** * BAR */" Property: string(29) "/** * FOO::$prop */" string(29) "/** * BAR::$prop */" Method: string(32) "/** * FOO::method() */" string(32) "/** * BAR::method() */"

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