+ 2

In Php !null return 1? Or return Boolean true?

PHP

21st Dec 2017, 7:31 PM
tess hsu
tess hsu - avatar
2 Antworten
+ 3
<?php error_reporting(E_ALL); $foo = NULL; var_dump(is_null($inexistent), is_null($foo)); ?> Notice: Undefined variable: inexistent in ... bool(true) bool(true) https://stackoverflow.com/questions/137487/null-vs-false-vs-0-in-php
21st Dec 2017, 7:40 PM
GAWEN STEASY
GAWEN STEASY - avatar
+ 1
I see, var_dump( null == false ); so in this case !null return true
21st Dec 2017, 7:50 PM
tess hsu
tess hsu - avatar