3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { private function __clone(){} private function __construct(){} public static function getInstance() { return new static(); } public function cloneIt() { $a = clone $this; return $a; } } class c extends a {} $d = c::getInstance(); $e = $d->cloneIt(); echo "x";
Output for 7.1.21
x