The ‘- >’ symbol is the “infix dereference operator”.
In other words, it is a method of calling a subroutine that passes parameters by reference (of course, there are other functions).
As we mentioned above, when calling PHP functions, most parameters are passed by reference.
The '->' functions in PHP are the same as they are in Perl or C++. The following is a simple dereference example:
Echo $x->def(); # Output
The '=>' operator is very common in PHP scripts. Because PHP array functions are rich, we often use arrays because they are very convenient for manipulating data.
$phparr= new array( in => 'reply,'side => 'left',padx => 2m,pady => 2m,ipadx => 2m,ipady => 1m)
By the way, if you need to use a numerical "greater than or equal to" symbol, you should use ">=" instead of "=>".
In PHP, "::" is called the range parsing operator, also known as the domain operator
The "::" symbol can be considered It is similar to "." in C language, and it is more like the :: class range operator in C++ (Perl).
#Qp Call the internal static members of the class, or call between classes::
This is an example:
class A { static $count = 0; static function haha() { // } function diaoyoug() { self::haha(); self::$count; } } a.b.c; /* C语言中的 */ a::b::c(); // C++ 中的函数 $a::b::c; # Perl 5中的标量
The above is the detailed content of Comparison between PHP operators and operators in other languages. For more information, please follow other related articles on the PHP Chinese website!