3v4l.org

run code in 300+ PHP versions simultaneously
<?php class xxyy { } class xx { function __construct() { return new xxyy(); } } $x= new xx(); $y= $x->__construct(); print_r($x); print_r($y);

preferences:
38.64 ms | 402 KiB | 5 Q