3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); trait ControlHelper { public const CONTROL_TEST = 'test'; public function getControl(string $name = self::CONTROL_TEST): void { } } abstract class BasePresenter { use ControlHelper; } class Presenter extends BasePresenter { } $method = new ReflectionMethod(Presenter::class, 'getControl'); foreach ($method->getParameters() as $param) { $tmp = $param->getDefaultValue(); var_dump($tmp); }
Output for git.master_jit, git.master
string(4) "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:
48.49 ms | 405 KiB | 5 Q