1--TEST-- 2Switch on numeric strings 3--FILE-- 4<?php 5 6function test($value) { 7 switch ($value) { 8 case "01": return "01"; 9 case "1": return "1"; 10 11 case " 2": return " 2"; 12 case "2": return "2"; 13 14 case "10.0": return "10.0"; 15 case "1e1": return "1e1"; 16 17 default: return "default"; 18 } 19} 20 21var_dump(test("1")); 22var_dump(test("2")); 23var_dump(test("1e1")); 24 25?> 26--EXPECT-- 27string(2) "01" 28string(2) " 2" 29string(4) "10.0" 30