PHP Manual-Language Reference-type-boolean Boolean type

Source: Internet
Author: User

1. Boolean expresses the true value, which can be false. Two are not case-sensitive.

2. The result of the Boolean value returned by the operator is usually passed to the control flow .

3. When converting to Boolean, the following values are considered false:

3.1 Boolean value false itself

3.2 Integer value 0

3.3 Floating-point value 0.0

3.4 Empty string, and string "0"

3.5 Arrays that do not include any elements

3.6 Objects that do not include any member variables (PHP 4.0 applies only)

3.7 Special type NULL (including variables that have not been assigned)

3.8 SimpleXML object generated from an empty tag

4. To explicitly convert a value to Boolean, use either (BOOL) or (Boolean) to cast. However, they are usually converted automatically.

PHP Manual-Language Reference-type-boolean Boolean type

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.