Afficher un message
Vieux 18/09/2007, 02h53   #2
ljb
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: diff between $x == null and is_null($x)

doannoahlot@dis.org wrote:
> Is there a meaningful/usefull difference
> between $x == null and is_null($x)?


Yes there is.
is_null($x) is the same as $x === NULL (3 equal signs for strict
compare). But $x == NULL (2 equal signs for loose compare) is also
true if $x is 0, FALSE, empty string, or empty array. is_null() is false
for all those.

See the Appendix R "PHP Type Comparison Tables" of the PHP manual.
  Réponse avec citation
 
Page generated in 0,04513 seconds with 9 queries