Extend Class with Final Constructor on PHP

后端 未结 6 979
栀梦
栀梦 2021-01-06 02:43

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         


        
6条回答
  •  悲哀的现实
    2021-01-06 03:13

    I would use Delegate wrapper design in this case. You should consider composition instead of inheritance here.

提交回复
热议问题