Java software engineer php-13-value transfer and reference transfer

Source: Internet
Author: User
Java programmers learn php-13. value passing is the same as passing a reference to php and Java. when calling a function, the basic data type is passed with a value, and the object is passed with a reference. However, php can also pass a reference to the basic data type (with & amp; symbol): $ w = 65; functionchange_ I java programmer learning php-13. value Transfer and reference transfer
Php is the same as Java. when a function is called, the basic data type is passed by value, and the object is passed by reference.

However, php can also transmit references to basic data types ( &Symbol ):

$ W = 65; function change_it (& $ weight) {$ weight = 60;} change_it ($ w); echo $ w; // 60

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.