情況:在處決投票時不能投給指定的人
條件:村民的登入名稱一人為"3"一人為"03"
分析:PHP在以"=="比較字串時,會把數字式字串(如"1"、"0.1"、"1E+1"等)變換為數字後比較,因"3"和"03"均被轉換為3,故("3"=="03")=true
建議:字串比較時可使用"==="(嚴密比較),效果為("3"==="03")=false
佐證:https://diam.ngct.net/old_log.php?log_mode=on&room_no=63268
參考:https://stackoverflow.com/questions/3333353/string-comparison-using-vs-strcmp