Annoying Poll

Where we keep all the boring tidbits about the PHPDN site, the news, and what not.

Moderator: General Moderators

Most annoying type/bug/error in PHP.

Missing ;
22
15%
if ( $supersecretpw = $test_password )
17
12%
((())())(()))(())((())
16
11%
}...hrm, now which one does this go to?
25
17%
Headers already sent, damnit!
36
25%
Notice: Undefined variable...grrr
7
5%
Function does not exist...*boom!*
5
3%
Internal Server Error 500...Noooooo!!!!
7
5%
.asp/.cfm/.jsp/.pl
0
No votes
Cannot access phpdn database. Database is unreachable...
10
7%
 
Total votes: 145

User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

why not set error reporting to E_ALL and display errors to on, if only during development? at least then, you don't have to spend time digging in the logs.. :)
User avatar
tonyrose
Forum Newbie
Posts: 1
Joined: Thu Sep 09, 2004 12:21 pm

Things that go booooooooom in the night

Post by tonyrose »

So I used to be sane, rational even a lovable person, then along came PHP !!!!! nuff said :?
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

the missing } 6 brackets is a headache, the missing ; also drive me crazy, but the biggest headache is creating dynamic javascript using php and get lost in all those \"'"\''\""'''''''' between the php code, javascript and html. arrrrrggghhhhhhhh.

best mistake is missing the where clause in update an delete.
JasonMichael
Forum Newbie
Posts: 8
Joined: Fri Sep 24, 2004 1:19 pm

Post by JasonMichael »

Here's a great typo:

Code: Select all

<?php

for ($x=0;$x<$count;$x++) ;
{

//... do your stuff here....

}
?>
Some newbie I was helping had that semi-colon immediately after his FOR statement, as illustrated above. PHP didn't even complain about the braces. For an hour I tried to help him figure out what the heck was going wrong with his code, until finally I saw that extra semi-colon that I kept missing - probably because it wasn't a nice "black-and-white" color, as it is here on this forum. It was some puke green color, and barely visible.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

reslut

Post by neophyte »

My favorite typo

$reslut = mysql_query($sql);

ever type that one?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

so we know who's sex deprived around here ;)

j/k dude.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

haha

Post by neophyte »

HHAHAHAHAHAHAHAHAHAHAHAHAHAHA

:D
Black Unicorn
Forum Commoner
Posts: 48
Joined: Mon Jun 16, 2003 9:19 am
Location: United Kingdom

Post by Black Unicorn »

The most error prone scripting is when I have to write some PhP that makes Javascript which in turn processes some strings. Like:

Code: Select all

<?php
for ($i=0;$i<sizeof($cluster);$i++){
   $js.= "document.writeln("This is a nice ".$cluster[$i]["name"]."");";
   $js.= "\r\ndocument.write("buildMenu('".$somename."')");";
}
?>
Hell, it may even be buggered as I demonstrate ...
The only reason I still vote for ; is because it is ALWAYS fair to assum it's a backslash issue before anything else when I deal with'em.

$moment->destroy();
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

What about gettting an INSERT statement caught in a loop... those are always fun... especially right after you ignore_user_abort and leave the script running for hours on end!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

I never thought this would happen to me... but guess what, it did just now and I thought I would share it with you..

elseif ($url == 'login' || $url = 'logout')



boy, that caused me some headaches...
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

Post by lostboy »

yeah, that whole file is on live server, file is dev server gets me all the time...the big problem is that we have two live servers in different places and the local dev server....nothing like hitting refresh 10 times and screaming at the monitor to show the damn debug echo statement that you know you just saved and loaded to the other damn server

:lol:
Post Reply