3v4l.org

run code in 300+ PHP versions simultaneously
<?php # THIS IS VERY SERIOUS :O # BY https://twitter.com/codelytv class_alias('Text', 'T'); class_alias('ListᐸTᐳ', 'ListᐸTextᐳ'); class Text { public $value; public function __construct(string $value) { $this->value = $value; } } class ListᐸTᐳ { public $elements; public function __construct(T ...$elements) { $this->elements = $elements; } } $listOfTexts = new ListᐸTextᐳ(new Text('first element'), new Text('second element')); var_dump($listOfTexts->elements);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> object(Text)#2 (1) { ["value"]=> string(13) "first element" } [1]=> object(Text)#3 (1) { ["value"]=> string(14) "second element" } }

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