PHP two values to compare the problem

Source: Internet
Author: User

The PHP manual operator is described in:

Compare multiple types--

such as Var_dump ([] > 0); Result is True

Number of operations 1 types Number of Operations 2 types Results
Null or string String NULLconvert to "" for numeric or lexical comparisons
BOOL or null Any other type Convert to bool, FALSE < TRUE
Object Object Built-in classes can define their own comparisons, non-homogeneous cannot be compared, the same class and arrays are the same way to compare properties (PHP 4), PHP 5 has its own description
String,resource, or number String,resource, or number Converts strings and resources to numbers, compared by ordinary numbers
Array Array Arrays with fewer members are smaller if the keys in the operand 1 do not exist in the operand 2, the array cannot be compared, otherwise the values are compared
Object Any other type object is always bigger
Array Any other type Array is always larger

PHP two values to compare the problem

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.