PHP variables reference and memory usage

后端 未结 2 1608
我寻月下人不归
我寻月下人不归 2020-12-11 16:05

According to php manual:


// Note:
// $a and $b are completely equal here. $a is not pointing to $b or vice versa.
// $a and $b          


        
2条回答
  •  天涯浪人
    2020-12-11 16:28

    PHP uses copy-on-write so it won't use more memory for the duplicated strings until you modify them.

提交回复
热议问题