Android programmers learn PHP Development (4)-variable reference-PhpStorm

Source: Internet
Author: User
No more textures, the printed results are directly written in the code, which is clearer than the textures. No more textures, the printed results are directly written in the code, which is clearer than the textures.

 "; Echo $ x; // print the result as B echo"
"; Echo $ x; // print the result as c echo"
"; Echo $ x; // print the result as d echo"
"; Echo $ x; // print the result as a echo"
"; Echo $ a; // print the result as B echo"
"; Echo $ B; // print the result as c echo"
"; Echo $ c; // print the result as d echo"
";/** You cannot print $ d because the variable * // ** is referenced in the variable */$ m = 10; $ n = 20; $ y = & $ m; // y refers to the value of m, which means that y is the alias of m echo $ y; // print the result as 10 echo"
"; $ M = $ n; echo $ y; // print the result as 20 echo"
";/*** Variable reference 1: * if the referenced variable is released, * the value before release */unset ($ m) is retained ); // release the given variable if (isset ($ y) {// This variable has echo "this variable exists"; // m is released, however, y saves the value before m release. echo"
"; Echo $ y; // print the result as 20 echo"
";}Else {echo" this variable does not exist ";} if (isset ($ m) {// This variable does not exist echo" this variable exists ";} else {echo "this variable does not exist"; // m is released, so echo does not exist"
";}/*** Variable reference 2: * when the second variable is referenced, the reference relationship with the first variable is automatically removed */$ p = 66; $ q = & $ p; // q refers to the value of p, which is equal to that of p. echo $ q; // print the result as 66 echo"
"; $ R = 77; $ q = & $ r; // q refers to the value of r, which means that q is the alias of r echo $ q; // print the result 66 echo"
"; $ Q = 88; // we change the q value to see if p and r change echo $ p; // The Print result is 66, and p does not change, q and p removed the reference relationship echo"
"; Echo $ r; // The printed result is 88, and r is changed to the q value, indicating that q and r form a new reference relationship echo"
";

The above is the PHP development for Android programmers (4)-variable reference-PhpStorm content. For more information, see PHP Chinese website (www.php1.cn )!

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.