__construct() vs SameAsClassName() for constructor in PHP

后端 未结 11 2759
南笙
南笙 2020-11-28 09:55

Is there any advantage to using __construct() instead of the class\'s name for a constructor in PHP?

Example (__construct):



        
11条回答
  •  我在风中等你
    2020-11-28 10:11

    If there is methods __construct and SameAsClassName method then __construct will be executed, SameAsClassName method will be skipped.

提交回复
热议问题