一千萬個為什麽

搜索

PHP函數,按值返回還是按引用返回?


當我在PHP中使用return語句時,結果是通過值還是通過引用返回的?

謝謝! ANDREE。

最佳答案

In PHP, everything is returned by value by default (I'm sure there are exceptions to this but I can't think of any atm). Except objects (PHP>5.0) which are passed by reference by default.

轉載註明原文: PHP函數,按值返回還是按引用返回?

猜你喜歡