How to avoid call-time pass-by-reference deprecated error in PHP?

后端 未结 5 695
情话喂你
情话喂你 2020-12-14 16:07

I\'m trying to reduce the warnings that are sent to my apache server log.

One warning is:

Call-time pass-by-reference has bee

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-14 16:36

    Actually, there's no problem with the way you define the function. Is a problem with the way you call the function. So for your example, instead of calling it like:

    takeScriptsWithMarker(&$lines, $marker);
    

    You'd call it like:

    takeScriptsWithMarker($lines, $marker); // no ampersands :)
    

    So the feature is still available. But I don't know the reason behind this change.

提交回复
热议问题