search

Home  >  Q&A  >  body text

The method name and class name are consistent. The default is the constructor. Is it 5.3 or 7.1 or later?

Which version does this writing method apply to?

小生我怕怕啊小生我怕怕啊2270 days ago1218

reply all(1)I'll reply

  • jesse

    jesse2018-09-06 12:58:00

    Before version 5, the constructor did not have an independent name. The function whose method name was the class name was the constructor of the current class. After version 5, __construct was introduced as the constructor of the class, and the same applies to version 7.

    QQ截图20180906125607.jpg

    QQ截图20180906125734.jpg

    reply
    0
  • Cancelreply