Creating functions without parentheses in PHP like 'echo'

前端 未结 2 1141
忘掉有多难
忘掉有多难 2021-01-05 06:50

I was wondering if there is any nice way of writing functions in PHP so that they don\'t require ( ) around the parameters.

Example:

function sayThis         


        
2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-05 07:17

    Simple answer, no.

    echo is a language construct not a function, hence it doesn't need the parentheses.

提交回复
热议问题