What do you mean by symbols------and::

Source: Internet
Author: User

After the basic PHP operators, the following again, the PHP novice frequently encountered problems, and, and:: What are these three guys are what the difference is what the AH! look very faint.

Okay, here's a detailed explanation, if you have a c++,perl base, you'll find that these guys and some of their symbolic functions are similar.

The '-> ' symbol is the ' pluggable dereference operator ' (infix dereference operator). In other words, it is a method of calling a subroutine that passes arguments by reference (and, of course, other functions). As we mentioned above, most of the parameters are passed by reference when invoking PHP's functions. The '-and ' features in PHP are the same as they are in Perl or C + +. Here is an example of a simple solution reference:

echo $x->def (); # output

  

The ' = = ' operator is common in PHP scripts. Because the PHP array functions are very rich, we often use arrays because it is convenient 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 equals" symbol, you should use ">=" instead of "=".

In PHP "::" This is called the scope resolution operator, aka domain operator

The "::" symbol can be thought of as "." In the C language. Similar, and it is more like C + + (Perl):: Class-scoped operators.

PHP calls the internal static members of a class, or calls between classes using:

Here is an example:
class A
{
static $count = 0;
static function haha ()
{
//
}
function Diaoyoug ()
{
Self::haha ();
Self:: $count;
}
}

A.B.C; /* * in the C language

A::b::c (); Functions in C + +

$a:: b::c; # Scalar in Perl 5

 

What do you mean by symbols------and::

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.