Home  >  Article  >  Backend Development  >  Analysis of the difference between number 0 and null value in php_PHP tutorial

Analysis of the difference between number 0 and null value in php_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:29:04810browse

As a qualified PHP programmer, you must know some basic knowledge, such as the difference between 0 and null. Regarding this difference, the following is a simple analysis through several examples. The truth can only be understood. , indescribable, readers can slowly experience it themselves.

Copy code The code is as follows:

$test=0;

if($test==''){
echo '
In php, 0 means empty'; //Output
}

if($test===''){
echo '
In php, 0 means empty'; //Not output
}

if($test==NULL){
echo '
In php, 0 means empty'; //Output
}

if($test===NULL){
echo '
In php, 0 means empty'; //Not output
}

if($test==false){
echo '
In php, 0 means empty'; //Output
}

if($test===false){
echo '
In php, 0 means empty'; //Not output
}

?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/779561.htmlTechArticleAs a qualified PHP programmer, you must know some basic knowledge, such as the difference between 0 and null, Regarding this difference, let’s conduct a simple analysis through several examples, among which...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn