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


Groups > comp.lang.php > #12653

Re: switch with range of comparisons

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "Peter H. Coffin" <hellsop@ninehells.com>
Newsgroups comp.lang.php
Subject Re: switch with range of comparisons
Date Mon, 13 Jan 2014 18:54:50 -0600
Lines 24
Message-ID <slrnld92mq.v5n.hellsop@nibelheim.ninehells.com> (permalink)
References <19ycnlnq3bdux$.jp8vxofzg98i.dlg@40tude.net>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Trace individual.net JQdYQIJca4t/o3+h2xSGbQKl7pTpUCi11Al+9/eLhjTtC+piJx
X-Orig-Path nibelheim.ninehells.com!_news
Cancel-Lock sha1:vKJBy6Jpta1AbsyZT1OkAwbwITo=
User-Agent slrn/0.9.9p1 (OpenBSD)
Xref csiph.com comp.lang.php:12653

Show key headers only | View raw


On Mon, 13 Jan 2014 18:35:07 -0500, richard wrote:
> switch ($value){
>
> case "A">="Z";
>
>
> }
>
> Would this be allowed?

Allowed? Yes. Does it solve your problem? Probably not. That case will
never be executed unless $value contains something that evaluates to
false. As "A">="Z" does.

> What I want to do is to have one case for all 26 letters of the
> alphabet without having to use ||.

Back further up. Most ways of answering that question are probably
useless. What problem are you trying to solve?

-- 
10. I will not interrogate my enemies in the inner sanctum -- a small 
   hotel well outside my borders will work just as well.
        --Peter Anspach's list of things to do as an Evil Overlord

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


Thread

switch with range of comparisons richard <noreply@example.com> - 2014-01-13 18:35 -0500
  Re: switch with range of comparisons Scott Johnson <noonehome@chalupasworld.com> - 2014-01-13 16:14 -0800
  Re: switch with range of comparisons "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2014-01-14 00:30 +0000
    Re: switch with range of comparisons Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-14 01:36 +0000
  Re: switch with range of comparisons "Peter H. Coffin" <hellsop@ninehells.com> - 2014-01-13 18:54 -0600
  Re: switch with range of comparisons Doug Miller <doug_at_milmac_dot_com@example.com> - 2014-01-14 01:26 +0000
    Re: switch with range of comparisons bill <william@TechServSys.com> - 2014-01-14 06:38 -0500
  Re: switch with range of comparisons daniel@honestempire.com - 2014-01-22 14:44 -0800
  Re: switch with range of comparisons Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-23 00:18 +0000
    Re: switch with range of comparisons testmehere@gmail.com (Jason) - 2014-03-11 18:51 -0500

csiph-web