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);

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for branch master
array(2) { [0]=> object(Text)#2 (1) { ["value"]=> string(13) "first element" } [1]=> object(Text)#3 (1) { ["value"]=> string(14) "second element" } }
Output for branch master_jit
array(2) { [0]=> object(Text)#2 (1) { ["value"]=> string(13) "first element" } [1]=> object(Text)#3 (1) { ["value"]=> string(14) "second element" } }

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