Dynamic Comparison Operators in PHP

后端 未结 11 696
挽巷
挽巷 2020-12-03 11:24

Is it possible, in any way, to pass comparison operators as variables to a function? I am looking at producing some convenience functions, for example (and I know this won\'

11条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-03 11:49

    No, it's impossible. You can use conditional operators instead, but it will be much,much better if you redesign your application to make such a dynamic comparison unnecessary.

提交回复
热议问题