summaryrefslogtreecommitdiff
path: root/Zend/tests/switch_on_numeric_strings.phpt
blob: b436cefe41a8482cba7a5419f3c5fcb277df9b7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--TEST--
Switch on numeric strings
--FILE--
<?php

function test($value) {
    switch ($value) {
        case "01": return "01";
        case "1": return "1";

        case " 2": return " 2";
        case "2": return "2";

        case "10.0": return "10.0";
        case "1e1": return "1e1";

        default: return "default";
    }
}

var_dump(test("1"));
var_dump(test("2"));
var_dump(test("1e1"));

?>
--EXPECT--
string(2) "01"
string(2) " 2"
string(4) "10.0"