Twitter Weekly Updates for 2010-01-24

  • i think i am hallucinating. i keep seeing a bug flying around in the corner of my eye, but whenever i turn my head to look, it's not there. #
  • after 3 failed H1N1 shot attempts, i'm finally getting mine tomorrow. too little too late? maybe, but better safe than sorry? #
  • Bbbbbbbbbb #
  • V #
  • lesson of the day: do not leave your twitter client open on your phone in your pocket…with your hand in your pocket. #
  • The kids in front of me got an H1N1 "shot", but it was administered through a nasal spray instead. I don't think adults have that option. #
  • man, they did not give me the option to get the H1N1 shot via nasal spray and now, i'm sure it's just my imagination, but my arm tingles! #
  • camera gear #
  • tired of looking at code. how to break the monotony? laundry. exciting weekend, eh? #
  • still writing code, but the football game is about to start! ugh. #
  • The antenna I'm using to watch HDTV OTA is 2" tall and 9" wide fully extended. http://twitpic.com/zljhl #
  • nice option pass by brad smith out of the wildcat to jerricho cotchery. NYJ are all about big plays. #
  • adrian peterson is willing his team to lose. it's time to stop giving him the ball. he's fumbled 3 times already? favre, all the way! #
  • live and die by the favre, man. at least this game is exciting. #

php – empty()

ugh, i just spent more time than i care to admit debugging a problem. the issue is that i had the wrong understanding of what the empty() function does in PHP. i always wondered where there are empty() and isset() functions in PHP, but never bothered to look up the differences.

it turns out:

$var=0;
if (empty($var)) {
print "this is empty";
}

will print “this is empty”.

why? because empty() considers many things like an empty string, 0 (as an integer or string), NULL, FALSE, array(), and a declared variable as empty. the cases that i have a beef with is 0. if i set something to 0, it isn’t empty, it’s value is 0! i guess that’s why i should have used isset() instead. lesson learned.