Stupid is as Stupid does

From: Date: Fri, 27 Feb 2009 07:19:50 +0000
Subject: Stupid is as Stupid does
Groups: php.general 
Request: Send a blank email to php-general+get-288903@lists.php.net to get a copy of this message
As my web app is coming to completion, I added a means to search records (different from site search). This involves reading post input and is many cases converting it to an integer. Damn I feel dumb. The search app wasn't working, so I did what I often do when troubleshooting crap - I put a die($variable) at various points to see if the variable is what it is suppose to be. I kept getting blank returns from die after the conversion from a post string to an integer. I looked in the apache logs, system logs, I even tried rebooting - I couldn't figure why the smurf the variable wasn't converting to integer. I even turned off eaccelerator in case that was causing it, though it never has given me issue before (except once when I was doing something in a really shoddy way - cleaned up my method and it behaved) After several hours contemplating if I had bad RAM, an issue with the CPU, verifying my RPMs were good, wondering why I wasn't getting anything in the logs, it dawned on me. If variable is an integer, die($var) returns nothing and is suppose to return nothing, it takes a string as an argument to echo on death - die("$var") is what I wanted. I need sleep. I did finally find the error and fix the record search problem.

« previous php.general (#288903) next »