php = &

Source: Internet
Author: User

$a= 12;$b=&$a;Echo $b;// AEcho"\ n";$b= 23;Echo $a;// atEcho"\ n";$a= 34;Echo $b;// theEcho"\ n";$c= Test ($b);Echo $b;//134Echo"\ n";Echo $a;//134Echo"\ n";Echo $c;//134Echo"\ n";$a= 342;Echo $c;//134Echo"\ n";Echo $b;//342Echo"\ n";@$b=& Test2 ($b);Echo $b;//442Echo"\ n";$c=&$b;$a= 154;Echo $c;//154Echo"\ n"; Test3 ($c);Echo $c;//0 $c and $and binding point to the same content, the method also binds the $and and $_get[' a '], but there is no variable $c within the Test3 method, the operation within the function is not in the $c scope of influenceEcho"\ n";$a= 111;functionTest (&$and){    return $and=$and+ 100;}functionTest2 ($and){    return $and=$and+ 100;}functionTest3 (&$and){    return $and&=$_get[' A '];//$_get[' a '] = 1}test (1);//1 is a constant is not a variable

= & Points Two variables to a value at the same time, and any one of the variable values changes and the other changes.

The parameter in the test method for example two is & $and returns the passed parameter $and, although the test ($b) is assigned to the $c, but $c is not an incoming parameter to test (), so $c does not change when the $b changes. The meaning of test (& $and) is that the value of passing in the parameter $and

php = &

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.