ph and C # Copy the value of the difference (if where the wrong, also hope to point out!)
$a = 2;
$b = $a; In PHP, the address of B is pointed to a so B is equal to 2 at this time; the difference is right here.
$a = 5; The value of a in PHP is then written back, so the PHP core will then reassign B to an address, and then copy the original value of a. This is the principle of write-time copying, which means that unless you write, the value type points to an address.
and in C #. Replication of value types. Always create a new address such as:
int a = 2;
int b = A; At this point, regardless of whether there is a two write. NET assigns a new memory space to B (the value exists in the stack space). And then we'll copy the value of a.
Note: value types in C # are stored directly in the stack. The reference type, the reference address is stored in the stack, and the actual value is stored in the heap. Depending on the address of the stack, find the value in the heap.