PHP operator precedence bug?

后端 未结 2 797
情歌与酒
情歌与酒 2020-12-18 03:09

The result of:

var_dump(null != $a = 15);
var_dump($a);

is:

bool(true)
int(15)

Why is this script not tri

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-18 03:48

    The only reason I can find is that the documentation says that this is still legal: http://php.net/manual/en/language.operators.precedence.php#example-129

    It seems to be an exception to what is shown in the table above.

提交回复
热议问题