PHP Symbols>, => and:-php Tutorial

Source: Internet
Author: User
The symbols-& gt;, & gt; and: in PHP do not matter. let's explain in detail. if you have C ++ and Perl basics, you will find that these guys are similar to some of their symbol functions.

'->' Indicates the "infix dereference operator)

In other words, it is a method that calls a subroutine that passes parameters by reference (of course, there are other functions ). As we mentioned above, most parameters are passed through reference when calling PHP functions. The '->' function in PHP is the same as that in Perl or C ++. The following is a simple example of unreferencing:

Echo $ x-> def (); # output

  

 The '=>' operator is common in PHP scripts. Because php array functions are rich, we often need to use arrays because it is very convenient to operate data.

$ Phparr = new array (in => 'Reply ,'

Side => 'left ',

Padx => 2 m,

Pady => 2 m,

Ipadx => 2 m,

Ipady => 1 m

)

By the way, if you need to use the digit "greater than or equal to", you should use "> =" instead of "=> ".

In PHP, ":" is called the range resolution operator and the domain name operator.

The ":" symbol can be considered to be similar to the "." symbol in C language, and it is more like the: class range operator in C ++ (Perl.

The internal static member of the php call class, or the call between classes, should be used ::

The following is an example:

Class

{

Static $ count = 0;

Static function haha ()

{

//

}

Function diaoyoug ()

{

Self: haha ();

Self: $ count;

}

}

A. B. c;/* c */

A: B: c (); // functions in C ++

$ A: B: c; # scalar in Perl 5

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.