3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private File $file { get => $this->file ??= new File($this->test1 . '-' . $this->test2 . '-' . random_int(0, PHP_INT_MAX)); } public function __construct( public string $test1, public string $test2, ) { } public function doStuffA() { var_dump($this->file->file . ' ~ A'); } public function doStuffB() { var_dump($this->file->file . ' ~ B'); } } class File { public function __construct( public string $file, ) { } } $t = new Test('a', 'b'); $t->doStuffA(); $t->doStuffB(); $t->doStuffA(); $t->doStuffB();
Output for git.master_jit
string(27) "a-b-1407834649150499553 ~ A" string(27) "a-b-1407834649150499553 ~ B" string(27) "a-b-1407834649150499553 ~ A" string(27) "a-b-1407834649150499553 ~ B"
Output for git.master
string(27) "a-b-9127558024736498635 ~ A" string(27) "a-b-9127558024736498635 ~ B" string(27) "a-b-9127558024736498635 ~ A" string(27) "a-b-9127558024736498635 ~ B"

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:
135.48 ms | 961 KiB | 7 Q