default as first option in switch statement?

前端 未结 9 1811
后悔当初
后悔当初 2020-12-01 23:58

I\'ve tested this and it works fine, but it looks... weird... to me. Should I be concerned that this is nonstandard form which will be dropped in a future version of PHP, or

9条回答
  •  一向
    一向 (楼主)
    2020-12-02 00:18

    Common practice is to define the default option as last option. But I see nothing wrong with your solution (if there is no predefined schema in your company how to layout your code)

提交回复
热议问题