Many on the Web say $ A = NULL is a direct null for the data structure pointed to by $ A, and its reference count to 0.
But my test found that it did not return 0, the code is as follows:
$s=str_repeat('1',2); //这和第二个例子完全相同 $p=&$s; $s=null; xdebug_debug_zval('s', 'p');
Print output:
s:(refcount=2, is_ref=1),nullp:(refcount=2, is_ref=1),null
The RefCount is still 2, and it's not classified as 0, and I don't know why.
Reply content:
Many on the Web say $ A = NULL is a direct null for the data structure pointed to by $ A, and its reference count to 0.
But my test found that it did not return 0, the code is as follows:
$s=str_repeat('1',2); //这和第二个例子完全相同 $p=&$s; $s=null; xdebug_debug_zval('s', 'p');
Print output:
s:(refcount=2, is_ref=1),nullp:(refcount=2, is_ref=1),null
The RefCount is still 2, and it's not classified as 0, and I don't know why.
$s=nullAfter this sentence is executed, S and P point to the object is null, the object's RefCount is 2, a little bit of a problem.