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