Purpose of PHP constructors

后端 未结 6 1710
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-30 20:14

I am working with classes and object class structure, but not at a complex level – just classes and functions, then, in one place, instantiation.

As to __const

6条回答
  •  情深已故
    2020-11-30 20:37

    constructor is function of class which is executed automatically when object of class is created we need not to call that constructor separately we can say constructor as magic method because in php magic method begin with double underscore characters

提交回复
热议问题