PHP: What are language constructs and why do we need them?

后端 未结 7 849
时光取名叫无心
时光取名叫无心 2020-12-17 15:12

I keep coming across statements like:

  • \"echo is a language construct but print is a function and hence has a return value\"
  • \"die is a language constr
7条回答
  •  庸人自扰
    2020-12-17 15:53

    To understand the answer for this question you must understand how parsers work. A language is defined by syntax and the syntax is defined through keywords.

    The language constructs are pieces of code that make the base of PHP language. The parser deals with them directly instead of functions.

提交回复
热议问题