Code snippet of the day

Sometimes working late has some side-effects. The other day I had a problem with a PHP script that should have taken 1 or 2 seconds to run and instead seemed to hang the webserver. Eventually I found the issue:

while ( $variable ) {
if ( $a == $b )
echo "do something";

Ermm… for some reason I never changed the value of $variable and of course the loop became infinite.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s