PHP Object Assignment vs Cloning

前端 未结 7 1250
后悔当初
后悔当初 2020-11-29 05:34

I know this is covered in the php docs but I got confused with this issue .

From the php docs :

$instance = new SimpleClass();
$assigned   =  $ins         


        
7条回答
  •  既然无缘
    2020-11-29 05:55

    well, basically those variables are nothing but pointers to the memory space, where object resides. If you store pointer value in another pointer, and then reset original pointer, nothing will happen to the memory area they both once pointed to.

提交回复
热议问题