scriptygoddess

22 Sep, 2004

Expression values

Posted by: Jennifer In: Bookmarks

PHP type comparison tables

For example if $x=""; what will empty($x) return? or is_null($x)? Or the even more surprising one: $x = "0" will return TRUE on empty() even though it is considered a string.

2 Responses to "Expression values"

1 | Mark J

September 22nd, 2004 at 7:59 pm

Avatar

Very tricky stuff… don't even get me started on the triple equals… if ($x === 1)

2 | michel

September 23rd, 2004 at 6:28 pm

Avatar

This is why empty() blows and why it should be avoided.
(And why checking the data type is most usually a good idea if you need accurate results!)

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements