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