3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace ParserReflection\Stub; abstract class AbstractClassWithMethods { const TEST = 5; public function __construct(){} public function __destruct(){} public function explicitPublicFunc(){} function implicitPublicFunc(){} protected function protectedFunc(){} private function privateFunc(){} static function staticFunc(){} abstract function abstractFunc(); final function finalFunc(){} /** * @return string */ public function funcWithDocAndBody() { static $a =5, $test = '1234'; return 'hello'; } /** * @return \Generator */ public function generatorYieldFunc() { $index = 0; while ($index < 1e3) { yield $index; } } /** * @return int */ public function noGeneratorFunc() { $gen = function () { yield 10; }; return 10; } private function testParam($a, $b = null, $c = self::class, $d = self::TEST) {} } $refMethod = new \ReflectionMethod('ParserReflection\Stub\AbstractClassWithMethods', 'testParam'); echo "Exported: ", $refMethod;
Output for git.master, git.master_jit, rfc.property-hooks
Exported: Method [ <user> private method testParam ] { @@ /in/P9DXo 52 - 52 - Parameters [4] { Parameter #0 [ <required> $a ] Parameter #1 [ <optional> $b = NULL ] Parameter #2 [ <optional> $c = 'ParserReflection\\Stub\\AbstractClassWithMethods' ] Parameter #3 [ <optional> $d = self::TEST ] } }

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