3v4l.org

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

preferences:
52.26 ms | 402 KiB | 5 Q