Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-13 Thread Eric Gorr
On Sep 12, 2008, at 5:13 PM, Robert Cummings wrote: On Fri, 2008-09-12 at 16:51 -0400, Eric Gorr wrote: On Sep 12, 2008, at 4:27 PM, Robert Cummings wrote: On Fri, 2008-09-12 at 16:11 -0400, Eric Gorr wrote: On Sep 12, 2008, at 3:44 PM, Robert Cummings wrote: I don't see how that in any

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-13 Thread Robert Cummings
On Sat, 2008-09-13 at 10:09 -0400, Eric Gorr wrote: On Sep 12, 2008, at 5:13 PM, Robert Cummings wrote: On Fri, 2008-09-12 at 16:51 -0400, Eric Gorr wrote: On Sep 12, 2008, at 4:27 PM, Robert Cummings wrote: On Fri, 2008-09-12 at 16:11 -0400, Eric Gorr wrote: On Sep 12, 2008, at 3:44

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-13 Thread Eric Gorr
On Sep 13, 2008, at 12:12 PM, Robert Cummings wrote: On Sat, 2008-09-13 at 10:09 -0400, Eric Gorr wrote: On Sep 12, 2008, at 5:13 PM, Robert Cummings wrote: On Fri, 2008-09-12 at 16:51 -0400, Eric Gorr wrote: On Sep 12, 2008, at 4:27 PM, Robert Cummings wrote: On Fri, 2008-09-12 at 16:11

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Luke
I wonder if this is a shared trait between C and PHP (since I understand PHP is written in C) that the break; and the default: are placed for good practice in all switch statements since they prevent memory leaks? 2008/9/10 Jochem Maas [EMAIL PROTECTED] tedd schreef: At 6:46 PM -0600 8/31/08,

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Jochem Maas
Luke schreef: I wonder if this is a shared trait between C and PHP (since I understand PHP is written in C) that the break; and the default: are placed for good practice in all switch statements since they prevent memory leaks? default is not required, never heard it was good practice to

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Andrew Ballard
On Fri, Sep 12, 2008 at 9:52 AM, Jochem Maas [EMAIL PROTECTED] wrote: Luke schreef: I wonder if this is a shared trait between C and PHP (since I understand PHP is written in C) that the break; and the default: are placed for good practice in all switch statements since they prevent memory

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Eric Gorr
On Sep 12, 2008, at 11:39 AM, Andrew Ballard wrote: On Fri, Sep 12, 2008 at 9:52 AM, Jochem Maas [EMAIL PROTECTED] wrote: Luke schreef: I wonder if this is a shared trait between C and PHP (since I understand PHP is written in C) that the break; and the default: are placed for good

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Robert Cummings
On Fri, 2008-09-12 at 10:58 +0100, Luke wrote: I wonder if this is a shared trait between C and PHP (since I understand PHP is written in C) that the break; and the default: are placed for good practice in all switch statements since they prevent memory leaks? Prevent memory leaks? WHAT? Even

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Robert Cummings
On Fri, 2008-09-12 at 11:47 -0400, Eric Gorr wrote: On Sep 12, 2008, at 11:39 AM, Andrew Ballard wrote: On Fri, Sep 12, 2008 at 9:52 AM, Jochem Maas [EMAIL PROTECTED] wrote: Luke schreef: I wonder if this is a shared trait between C and PHP (since I understand PHP is written

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread tedd
At 10:58 AM +0100 9/12/08, Luke wrote: I wonder if this is a shared trait between C and PHP (since I understand PHP is written in C) that the break; and the default: are placed for good practice in all switch statements since they prevent memory leaks? First, the evolution of computer

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Eric Gorr
On Sep 12, 2008, at 2:14 PM, Robert Cummings wrote: On Fri, 2008-09-12 at 11:47 -0400, Eric Gorr wrote: On Sep 12, 2008, at 11:39 AM, Andrew Ballard wrote: On Fri, Sep 12, 2008 at 9:52 AM, Jochem Maas [EMAIL PROTECTED] wrote: Luke schreef: I wonder if this is a shared trait between C and

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Robert Cummings
On Fri, 2008-09-12 at 14:33 -0400, Eric Gorr wrote: On Sep 12, 2008, at 2:14 PM, Robert Cummings wrote: On Fri, 2008-09-12 at 11:47 -0400, Eric Gorr wrote: On Sep 12, 2008, at 11:39 AM, Andrew Ballard wrote: On Fri, Sep 12, 2008 at 9:52 AM, Jochem Maas [EMAIL PROTECTED] wrote: Luke

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Eric Gorr
On Sep 12, 2008, at 2:51 PM, Robert Cummings wrote: On Fri, 2008-09-12 at 14:33 -0400, Eric Gorr wrote: On Sep 12, 2008, at 2:14 PM, Robert Cummings wrote: On Fri, 2008-09-12 at 11:47 -0400, Eric Gorr wrote: On Sep 12, 2008, at 11:39 AM, Andrew Ballard wrote: On Fri, Sep 12, 2008 at 9:52

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Robert Cummings
On Fri, 2008-09-12 at 15:15 -0400, Eric Gorr wrote: On Sep 12, 2008, at 2:51 PM, Robert Cummings wrote: On Fri, 2008-09-12 at 14:33 -0400, Eric Gorr wrote: On Sep 12, 2008, at 2:14 PM, Robert Cummings wrote: On Fri, 2008-09-12 at 11:47 -0400, Eric Gorr wrote: On Sep 12, 2008, at 11:39

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Eric Gorr
On Sep 12, 2008, at 3:44 PM, Robert Cummings wrote: I don't see how that in any way makes an argument for or against. Once still must spend client's money wasting time on code that has questionable merit. Yes, some debugging code is a great boon in any application, but littered everywhere to

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Robert Cummings
On Fri, 2008-09-12 at 16:11 -0400, Eric Gorr wrote: On Sep 12, 2008, at 3:44 PM, Robert Cummings wrote: I don't see how that in any way makes an argument for or against. Once still must spend client's money wasting time on code that has questionable merit. Yes, some debugging code is a

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Eric Gorr
On Sep 12, 2008, at 4:27 PM, Robert Cummings wrote: On Fri, 2008-09-12 at 16:11 -0400, Eric Gorr wrote: On Sep 12, 2008, at 3:44 PM, Robert Cummings wrote: I don't see how that in any way makes an argument for or against. Once still must spend client's money wasting time on code that has

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Robert Cummings
On Fri, 2008-09-12 at 16:51 -0400, Eric Gorr wrote: On Sep 12, 2008, at 4:27 PM, Robert Cummings wrote: On Fri, 2008-09-12 at 16:11 -0400, Eric Gorr wrote: On Sep 12, 2008, at 3:44 PM, Robert Cummings wrote: I don't see how that in any way makes an argument for or against. Once

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-12 Thread Ashley Sheridan
Well, I've often found the need to treat several conditions with the same set of statements within a switch: switch($some_number) { case 1: case 2: { // do some shizzle break; } case 3: { // foshizzle that nizzle break; } default:

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-09 Thread tedd
At 6:46 PM -0600 8/31/08, Govinda wrote: Not that it is an issue, but just to understand the logic- Why do we have to use 'break' statements in each case? switch ($i) { case 0: echo i equals 0; break; case 1: echo i equals 1; break; case 2: echo i equals 2; break; } all

Re: [PHP] switch case - to require the break statements seems strange to me

2008-09-09 Thread Jochem Maas
tedd schreef: At 6:46 PM -0600 8/31/08, Govinda wrote: Not that it is an issue, but just to understand the logic- Why do we have to use 'break' statements in each case? switch ($i) { case 0: echo i equals 0; break; case 1: echo i equals 1; break; case 2: echo i equals 2;

Re: [PHP] switch case - to require the break statements seems strange to me

2008-08-31 Thread Jochem Maas
Govinda schreef: Not that it is an issue, but just to understand the logic- Why do we have to use 'break' statements in each case? switch ($i) { case 0: echo i equals 0; break; case 1: echo i equals 1; break; case 2: echo i equals 2; break; } all 3 cases fire, even