I want extend class which have final constructor (in my case it\'s SimpleXMLElement), but i have problems because when i use:
class myclass extends Simpl
Well, final means final. No overriding the method. Even if you ask nicely. I suggest adding a static make() method to your new class. Something like:
class myclass extends SimpleXMLElement {
static function make($data, $xmlVersion='1.0', $xmlEncoding='ISO-8859-1', $rootName='root'){
$obj=parent::__construct($data);
$obj->x=$xmlVersion;
$obj->e=$xmlEncoding;
$obj->r=$rootName;
return $obj;
}
}