3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private ?string $b = null; public static function newInstance($args){ return new self($args); } public function __construct($b = 'default') { $this->b = $b; } public function test() { echo("Test:" . $this->b . "\n"); } } $a = new A('test'); $a->test(); var_dump(class_exists('\\A')); $b = new ReflectionClass('A'); $c = $b->newInstance(); $c->test(); var_dump(class_exists('\\A'));
Output for git.master_jit, git.master, rfc.property-hooks
Test:test bool(true) Test:default bool(true)

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