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 SimpleXMLElement {
function __construct($xmlVersion='1.0', $xmlEncoding='ISO-8859-1', $rootName='root'){
parent::__construct("<?xml version='$xmlVersion' encoding='$xmlEncoding'?><$rootName />");
}
I get error:
Fatal error: Cannot override final method SimpleXMLElement::__construct()
When i delete constructor i get this error:
Fatal error: Uncaught exception 'Exception' with message 'SimpleXMLElement::__construct() expects at least 1 parameter, 0 given'
I miss something or doesn't understand how properly call parent constructor which is final. I don't want override methods just expand class, but i can't expand because it required __construct(). So i missed something and back where started.
Can somebody explain where i was wrong?