3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class xxyy { } class xx { function __construct() { return new xxyy(); } } $x= new xx(); $y= $x->__construct(); echo print_r($x); echo print_r($y);
based on pdX48
Output for 4.3.0 - 7.1.0
xx Object ( ) 1xxyy Object ( ) 1