Variable reference count issues

Source: Internet
Author: User
Variable references let people get into the mess.
What references, separates, writes when copied, changes when writing .....
Like what:
   
RefCount test out the results are different, xdebug quasi or built-in debug_zval_dump quasi?


Reply to discussion (solution)

Call Debug_zval_dump ($a); When the parameter and $ A are separated debug_zval_dump calls can refer to the following conditions

$a = 1;

$b = & $a

$c = $a

Reference http://www.laruence.com/2008/09/19/520.html

Reference http://www.laruence.com/2008/09/19/520.html


It's just a matter of reading this article.

The RefCount in the report of two functions is not a meaning
Please don't be fooled by smattering's article.

The RefCount in the report of two functions is not a meaning
Please don't be fooled by smattering's article.



What do you mean by that distinction?

These two functions are not all used to view the reference count

These two functions are not all used to view the reference count



Check the app Count
Debug_zval_dump ($a); Please refer to Debug_zval_dump (& $a); Because you have this kind of invocation as in the following case read and write separation $c has been separated from $ A

$a = 1;
$b = & $a
$c = $a

Xdebug_debug_zval is really a reference count and Debug_zval_dump is a reference count +1 because it is passed to it
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.