3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { final protected function __clone() { throw new Exception("No cloning!"); } } class B extends A { // this should probably not be legal function copy() { return clone $this; } } var_dump((new B)->copy());

preferences:
48.01 ms | 1517 KiB | 5 Q