- var_dump: documentation ( source)
<?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());