Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #12679

Re: switch says value is equal to case when it is not

From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.php
Subject Re: switch says value is equal to case when it is not
Date 2014-01-15 18:06 +0000
Organization A noiseless patient Spider
Message-ID <lb6in8$50a$3@dont-email.me> (permalink)
References <x76wm4qeiagq.vnb3xbwh1l0o$.dlg@40tude.net> <c905b5ea-ea60-4ad1-ba81-235dd7e7fbf6@googlegroups.com>

Show all headers | View raw


On Wed, 15 Jan 2014 09:32:47 -0800, Frank Catry wrote:

> between every CASE you need BREAK;

Actually you don't, and in this case he probably doesn't.

If he wants to use a switch case to execute a single statement on any of  
multiple matches, he needs to use the appropriate combination of case and 
break statements, as described and demonstrated at 

http://www.php.net/manual/en/control-structures.switch.php

His biggest problem at the moment is that he doesn't understand that the 
comparison that's being made is not the comparison that he thinks is 
being made.

A secondary problem that he has had for a long time is that occasionally 
he picks up on a piece of incorrect crap that he reads on the internet 
such as "between every CASE you need BREAK;", latches on to it, and then 
remains convinced that it is gospel writ by the almighty himself even 
when he is told quite clearly that it is wrong.

-- 
Denis McMahon, denismfmcmahon@gmail.com

Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

switch says value is equal to case when it is not richard <noreply@example.com> - 2014-01-14 14:54 -0500
  Re: switch says value is equal to case when it is not "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2014-01-14 20:42 +0000
  Re: switch says value is equal to case when it is not Doug Miller <doug_at_milmac_dot_com@example.com> - 2014-01-14 21:09 +0000
  Re: switch says value is equal to case when it is not Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-14 22:15 +0000
  Re: switch says value is equal to case when it is not Frank Catry <frank.catry@gmail.com> - 2014-01-15 09:32 -0800
    Re: switch says value is equal to case when it is not Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-15 18:06 +0000

csiph-web