Re: [PHP] Wierd ass code...

2006-05-15 Thread Chris
Richard Lynch wrote: On Sat, May 13, 2006 6:37 pm, Rory Browne wrote: There are some cases where the Error Suppression operator may be useful in good code. Last I checked, you pretty much HAD to use it for pg_fetch_row() since it does an E_NOTICE when you try to fetch a row beyind the number

Re: [PHP] Wierd ass code...

2006-05-15 Thread Ryan A
Hey Rich, > > // Add to the running totals > > @$hits["$username|$subnet"]++; > > @$bytes["$username|$subnet"]+=$byte; > > @$baps["$username|$subnet|$this_second"]++; > > @$bapm["$username|$subnet|$this_minute"]++; > > @ is suppressing the E_NOTICE error message that the > variables are not > pre

Re: [PHP] Wierd ass code...

2006-05-15 Thread Richard Lynch
On Sat, May 13, 2006 6:37 pm, Rory Browne wrote: > There are some cases where the Error Suppression operator may be > useful in > good code. Last I checked, you pretty much HAD to use it for pg_fetch_row() since it does an E_NOTICE when you try to fetch a row beyind the number available... You co

Re: [PHP] Wierd ass code...

2006-05-15 Thread Richard Lynch
On Sat, May 13, 2006 2:20 pm, Ryan A wrote: > Been reading some other code that I got from the net, > and have come across some wierd looking code, would > appreciate it if someone could explain it to me: > > $hits = array(); > $bytes = array(); > $blocked = array(); > $baps = array(); > $bapm = a

Re: [PHP] Wierd ass code...

2006-05-15 Thread Gonzalo Monzón
Robin Vickery escribió: On 14/05/06, Gonzalo Monzón <[EMAIL PROTECTED]> wrote: Satyam escribió: > Of course, another possibility is that the author does not know how to > handle multidimensional arrays (just to say it before anyone else > points an obvious alternative) > I don't think the aut

Re: [PHP] Wierd ass code...

2006-05-15 Thread Robin Vickery
On 14/05/06, Gonzalo Monzón <[EMAIL PROTECTED]> wrote: Satyam escribió: > Of course, another possibility is that the author does not know how to > handle multidimensional arrays (just to say it before anyone else > points an obvious alternative) > I don't think the author does not know how to ha

Re: [PHP] Wierd ass code...

2006-05-15 Thread Gonzalo Monzón
Gonzalo Monzón escribió: Attached results and code. (tested on PHP 4.3.4) -- Testing bidimensional and single dimension array manipulation Fill style A, bidimensional array: 2,1603 Iteration style A, bidimensional array: 9,9071 Total

Re: [PHP] Wierd ass code...

2006-05-13 Thread Gonzalo Monzón
Satyam escribió: - Original Message - From: "Satyam" <[EMAIL PROTECTED]> To: "Ryan A" <[EMAIL PROTECTED]>; "php php" Sent: Saturday, May 13, 2006 9:53 PM Subject: Re: [PHP] Wierd ass code... - Original Message - From: "

Re: [PHP] Wierd ass code...

2006-05-13 Thread Robert Cummings
On Sat, 2006-05-13 at 19:37, Rory Browne wrote: > > I would submit that the error suppression operator isn't BAD BAD BAD > per se - it's just like goto, in that 99% of its use is bad. In the > absence of a comment justifying it, the error-suppressed expression is > BAD. > > There are some cases w

Re: [PHP] Wierd ass code...

2006-05-13 Thread Rory Browne
> > // Add to the running totals > @$hits["$username|$subnet"]++; > @$bytes["$username|$subnet"]+=$byte; > @$baps["$username|$subnet|$this_second"]++; > @$bapm["$username|$subnet|$this_minute"]++; > > What kind of arrays are the above? I have never seen > nor worked with arrays like them before. >

Re: [PHP] Wierd ass code...

2006-05-13 Thread Ryan A
Thanks Rob, Satyam, I understood the error supression but never came across arrays where people were creating keys on the fly like this and incrementing themjust looked a bit weird to me. Cheers! Ryan --- Robert Cummings <[EMAIL PROTECTED]> wrote: > On Sat, 2006-05-13 at 15:20, Ryan A wrot

Re: [PHP] Wierd ass code...

2006-05-13 Thread Satyam
- Original Message - From: "Satyam" <[EMAIL PROTECTED]> To: "Ryan A" <[EMAIL PROTECTED]>; "php php" Sent: Saturday, May 13, 2006 9:53 PM Subject: Re: [PHP] Wierd ass code... - Original Message - From: "Ryan A" <[E

Re: [PHP] Wierd ass code...

2006-05-13 Thread Robert Cummings
On Sat, 2006-05-13 at 15:20, Ryan A wrote: > Hey, > Been reading some other code that I got from the net, > and have come across some wierd looking code, would > appreciate it if someone could explain it to me: > > $hits = array(); > $bytes = array(); > $blocked = array(); > $baps = array(); > $b

Re: [PHP] Wierd ass code...

2006-05-13 Thread Satyam
- Original Message - From: "Ryan A" <[EMAIL PROTECTED]> To: "php php" Sent: Saturday, May 13, 2006 9:20 PM Subject: [PHP] Wierd ass code... Hey, Been reading some other code that I got from the net, and have come across some wierd looking code, would appreciate it if someone could