CLASS) only on remote (not in local)

This question already has an answer here:

  • PHP parse/syntax errors; and how to solve them? 13 answers

  • Using class as a name of a constant is available in PHP 5.5 only.

    To get the class name you can replace VisiteMaisonInvestisseur::class with get_class(new VisiteMaisonInvestisseur) .

    Or change the name of the constant. For example: VisiteMaisonInvestisseur::class_name .


    The problem is with VisitMaisonInvestisseur::class . class is a reserved word in PHP, so you can't use it as the name of a constant.

    If it works on your local server, it must be version-specific. But I've tested this in 5.3 and 5.6, and they both report an error for Classname::class .

    链接地址: http://www.djcxy.com/p/69896.html

    上一篇: 语法错误,意外的T

    下一篇: CLASS)只在远程(不在本地)