Bug #2595: switch/case String is no scalar type

From: Date: Sun, 24 Oct 1999 06:48:05 +0000
Subject: Bug #2595: switch/case String is no scalar type
Groups: php.dev 
Request: Send a blank email to php-dev+get-11853@lists.php.net to get a copy of this message
From: naklar@altavista.net Operating system: all PHP version: 3.0.12 PHP Bug Type: Documentation problem Bug description: switch/case String is no scalar type 2. switch/case http://www.php.net/manual/html/control-structures.switch.html) "The case expression may be any expression that evaluates to a scalar type, that is, integer or floating-point numbers and strings. Arrays or objects are meaningless in that context. " Strings is no scalar, but a composed type. Type CHAR in Pascal is a scalar, which compares to a string of length one. It's even under discussion, whether a real number is a scalar type. This ist, Because the always existing rounding errors with reals may prohibit one to give them the attribute scalar type. You better could tell the readers only, that they cannot use Arrays and Objects in switch/case, but anything else and let off the other stuff. Anyway, thanks for your efforts, oK

« previous php.dev (#11853) next »