[dev] [commits] Horde branch master updated. a4b07653ae2a6b292850652903cc7d534ef43c52

Michael M Slusarz slusarz at horde.org
Thu Feb 24 21:33:41 UTC 2011


Quoting Jan Schneider <jan at horde.org>:

> Zitat von Michael M Slusarz <slusarz at horde.org>:
>
>> commit 9b8de0b2d4cec4dc23c3efe527211eb8740a2efd
>> Author: Michael M Slusarz <slusarz at curecanti.org>
>> Date:   Wed Feb 23 12:20:34 2011 -0700
>>
>>    Guess you can't use switch in this manner
>>
>> framework/Imap_Client/lib/Horde/Imap/Client/Ids.php |   17 +++++------------
>> 1 files changed, 5 insertions(+), 12 deletions(-)
>>
>> http://git.horde.org/horde-git/-/commit/9b8de0b2d4cec4dc23c3efe527211eb8740a2efd
>
> No, but you can do something like:
>
> switch (true) {
> case $ids == self::ALL:
> case $ids == self::SEARCH_RES:
>     ...
> case is_array($ids):
>     ...
> }

I'm guessing that was my issue.  Once you add a base string comparison  
object to the switch (e.g. 'case foo:'), PHP interprets all the  
remaining cases as string comparisons and doesn't parse the given  
expression statement.

michael

-- 
___________________________________
Michael Slusarz [slusarz at horde.org]




More information about the dev mailing list