if(0 == '%') echo “WTF, Php, why can't you compare things sanely?”

后端 未结 5 869
灰色年华
灰色年华 2021-01-13 03:31

I just reduced a crazy bug to what\'s in the title of this question. I\'m sure there\'s a Perfectly Reasonable Explanation for why Php thinks that 0 == \'%\' (or any other s

5条回答
  •  梦毁少年i
    2021-01-13 04:17

    It will do the same to any string, converting a non-number string to integer always gives 0.

提交回复
热议问题