In PHP symbol - meaning> => and __, usage

'->' symbol is "plug-dereference operator" (infix dereference operator). In other words, it is a subroutine call method (of course, there are other effects) parameters passed by reference. As we mentioned above, when calling the PHP function, most of the parameters are passed by reference. PHP in the '->' function on and they were in Perl or C ++. The following is an example of a simple solution references:

  echo $ x-> def (); # Output

  In PHP script '=>' common when the operator. Because php array functions is very rich, we have to use an array of often, because it is very easy to manipulate the data. $ Phparr = new array (in => 'reply,'

  side => 'left',

  padx => 2m,

  pady => 2m,

  ipadx => 2m,

  ipady => 1m

  )

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

 在PHP中“::”这个叫范围解析操作符,又名域运算符  

 “::”符号可以认为是与C语言中的“.”相似的,而它更像C++中(Perl)的::类范围操作符。

  php调用类的内部静态成员,或者是类之间调用就要用::

下面是一个例子:
  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 中的标量

“===”(三等号) 或许有人就疑问了,此符号除了判断两变量是否相等外,还会判断值类型是否一致,若值类型不一样,则会返回 False,比如:$a="1";// 字符型 1 $b=1;// 数字型 1 当执行 $a===$b; 时,将返回 False

“->”(减号、右尖括号) 用于类中,访问类里的函数或对象,比如:

do_test(); ?>

"=>"(等号、右尖括号) 数组中给值赋值,比如:$arr=array("one" =>("1"=>10, "2"=>20), "two"=>2); 那么 $arr["one"]["1"]=10;

Guess you like

Origin www.cnblogs.com/jjiaper/p/12575931.html