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

后端 未结 7 863
时光取名叫无心
时光取名叫无心 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:52

    language constructs can be formed in more than one way and has a return-value

    print("asdf"); is as possible as print "asdf"; and will return 1.

    echo("asdf"); is equal to echo "asdf;" but has no return-value.

    die("asdf"); is equal to exit("asdf"); and hasn't a return-value too.

提交回复
热议问题