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-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

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 wa

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-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.

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: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

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 fu

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

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 A

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]> >

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 an

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 languag

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 > >>> underst

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? Ev

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 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 prev

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 always

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

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-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; }

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

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

2008-08-31 Thread Govinda
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 though $i only eq