drcomwc134525 2013-09-03 16:42
浏览 111

PHP表达式:为什么var_dump(false <-1)= true?

Can you please explain how PHP execute this code and the result is true?

var_dump( (false < -1) ); //bool(true)
  • 写回答

2条回答 默认 最新

  • dream1849 2013-09-03 16:46
    关注

    False is boolean type, and from PHP maunal:

    -1 is considered TRUE, like any other non-zero (whether negative or positive) number!

    Resource: http://php.net/bool

    评论

报告相同问题?