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

后端 未结 3 2100
暗喜
暗喜 2021-02-15 12:15

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:38

    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.

提交回复
热议问题