0, ", null, false, true, flase, treu, and array () in PHP.

Source: Internet
Author: User
Tags php source code

Introduction: This is a detailed page for learning equality among 0, '', null, false, true, flase, treu, and array () in PHP. It introduces PHP, related knowledge, skills, experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 341541 'rolling = 'no'>

"Null"Means"Nothing". The VaR has not been initialized.

"False"Means"Not true in a Boolean Context". Used to explicitely show you are dealing with logical issues.

0IsInt. Nothing to do with the rest above, used for mathematics.

Now, what is tricky, it's that in dynamic versions like PHP,All of them have a value in a Boolean Context, Which is "false ".

If you test it with "=", it's testing the Boolean value, so you will get duplicate ity. if you test it with "=", it will test the type, and you will get inequality.

// Compare the value ''null 0 false True False true arrau ()
// Equal judgment
// ''= NULL = 0 = false (equal)
// Array () = 0 = NULL = false (equal)
// Array () <> ''(not equal)
// Constant level judgment
// None of the two numbers is constant. // var_dump (false = false); // bool (true)
// Var_dump (false = false); // bool (true)
// Var_dump (true = true); // bool (true)
// Var_dump (true = true); // bool (true) // var_dump (''= NULL); // bool (true)
// Var_dump (''= NULL); // bool (false)
// Var_dump (''= 0); // bool (true)
// Var_dump (''= 0); // bool (false)
// Var_dump (''= false); // bool (true)
// Var_dump (''= false); // bool (false)
// Var_dump (''= true); // bool (false)
// Var_dump (''= true); // bool (false) // var_dump (null = 0); // bool (true)
// Var_dump (null = 0); // bool (false)
// Var_dump (null = false); // bool (true)
// Var_dump (null = false); // bool (false)
// Var_dump (null = true); // bool (false)
// Var_dump (null = true); // bool (false) // var_dump (0 = false); // bool (true)
// Var_dump (0 = false); // bool (false)
// Var_dump (0 = true); // bool (false)
// Var_dump (0 = true); // bool (false) // some true judgments
// Var_dump ('1' = true); // bool (true)
// Var_dump ('1' = true); // bool (false)
// Var_dump (1 = true); // bool (true)
// Var_dump (1 = true); // bool (false)
// Var_dump (Array () = true); // bool (false)
// Var_dump (Array () === true); // bool (false) // array () Comparison
// Var_dump (Array () = ''); // bool (false)
// Var_dump (Array () = ''); // bool (false)
// Var_dump (Array () = NULL); // bool (true)
// Var_dump (Array () === null); // bool (false)
// Var_dump (Array () = 0); // bool (false)
// Var_dump (Array () = 0); // bool (false)
// Var_dump (Array () = false); // bool (true)
// Var_dump (Array () = false); // bool (false)
// Var_dump (Array () = true); // bool (false)
// Var_dump (Array () = true); // bool (false) // constant comparison
// Var_dump (0 = '0'); // bool (false)
// Var_dump (0 = 00); // bool (true)
// Var_dump (00 === intval ('0'); // bool (true)

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/341541.html pageno: 6.

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.