PHP Detail Analysis

Source: Internet
Author: User

php is a weakly typed language, but it also has the concept of data type, on the contrary, because PHP is not very strict in the data type, so when learning, often do not pay attention to the use of errors, these errors , many times it appears in the judgment of the data type, ambiguous, disorderly operation caused. The following analysis of common operations:

1, "= =" and "= = =" The difference between

"= =" comparison operator, does not check the type of the expression it would consider an empty string, 0, false is null
"= = =" constant equals, while checking the value and type of an expression Only if the value of one variable is true is NULL, it represents null

<?php//== versus = = = NULL; $STR 2 = $str1 STR3 = 0; $str 4 = "", echo $str 1 = = null? ' Yes<br/> ': ' no<br/> ';//yesecho $str 1 = = = null?   ' yes 

2, isset () differs from empty ()

 

3,

 

PHP Detail Analysis

Related Article

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.