PHP 8.5.0 Alpha 2 available for testing

Voting

: two plus six?
(Example: nine)

The Note You're Voting On

fahimcseiiuc at gmail dot com
6 years ago
<?php

/*"" (an empty string)
0 (0 as an integer)
0.0 (0 as a float)
"0" (0 as a string)
NULL
FALSE
array() (an empty array)*/

$anEmptyString = "";
empty(
$anEmptyString);
if(empty(
$anEmptyString) == TRUE){
echo
"TRUE";
} else{
echo
"FALSE";
}
echo
"<hr>"; //line break

$anIntegerNumber = 0;
empty(
$anIntegerNumber);
if(empty(
$anIntegerNumber) == TRUE){
echo
"TRUE";
} else{
echo
"FALSE";
}
echo
"<hr>"; //line break

$aFloatNumber = 0.0;
empty(
$aFloatNumber);
if(empty(
$aFloatNumber) == TRUE){
echo
"TRUE";
} else{
echo
"FALSE";
}
echo
"<hr>"; //line break

$aZeroValuedString = "0";
empty(
$aZeroValuedString);
if(empty(
$aZeroValuedString) == TRUE){
echo
"TRUE";
} else{
echo
"FALSE";
}
echo
"<hr>"; //line break

$aNULL = NULL;
empty(
$aNULL);
if(empty(
$aNULL) == TRUE){
echo
"TRUE";
} else{
echo
"FALSE";
}
echo
"<hr>"; //line break

$aBooleanFALSE = FALSE;
empty(
$aBooleanFALSE);
if(empty(
$aBooleanFALSE) == TRUE){
echo
"TRUE";
} else{
echo
"FALSE";
}
echo
"<hr>"; //line break

$anEmptyArray = array();
empty(
$anEmptyArray);
if(empty(
$anEmptyArray) == TRUE){
echo
"TRUE";
} else{
echo
"FALSE";
}
echo
"<hr>"; //line break

?>

<< Back to user notes page

To Top