4) PHP naming rules, value-transfer method

Source: Internet
Author: User

(1) Naming rules:

including variable names, class names, interface name functions, and so on

① Basic Rules:

Use only lowercase letters, underscores, or numbers

Number cannot start

Cannot repeat with environment and system keywords (for example, if,else,function)

② Hump Type: Name Nameschool myfather

Pascal named: MyName nameschool Myfther

Underline interval: My_name my_father

(2) The method of passing values between variables:

① in PHP, the default is value passing

To refer to a pass, you use &

1 $v 1=;                2 $v 2=$v 1;              This occurred a value passed 3 $v 3= $v 1+;        This does not occur value passed

(3) Reference passing:

1$v 1 =411;2$v 2=&$v 1;3$v 1 =Ten;4 echo $v 2;5 6 7The resulting output is:Ten(same as $V1)8 9 Ten But if the value is passed: One      A$v 1 =411; -$v 2 =$v 1; -$v 1 =Ten; the echo $v 2; -    -  -The result is:411(As with the beginning $v1)

4) PHP naming rules, value-transfer method

Related Article

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.