Do I need to use the ampersand in PHP 5.5.X and above anymore?

后端 未结 3 1155
误落风尘
误落风尘 2021-02-15 11:36

I\'m getting mixed signals all over the place.

Do I use the ampersand to pass variables by reference or not?

The following link seems to tell me that it is depre

3条回答
  •  后悔当初
    2021-02-15 12:23

    No, those are not the same. PHP 5.4+ just detects on call whether reference is needed when the function is called by checking the declaration.

    So no, not deprecated since you need the reference operator in the function declaration if that is your intended usage.

提交回复
热议问题