CascadiaPHP 2024

Voting

The Note You're Voting On

mark at theanti dot social
6 years ago
There is also 0.0 which is not identical to 0.

$x = 0.0;
gettype($x); // double
empty($x); // true
is_null($x); //false
isset($x); // true
is_numeric($x); // true
$x ? true : false; // false
$x == 0; // true
$x == "0"; // true
$x == "0.0"; // true
$x == false; // true
$x == null; // true
$x === 0; // false
$x === false; // false
$x === null; // false
$x === "0"; // false
$x === "0.0"; // false

<< Back to user notes page

To Top