三元运算符返回false但执行左侧?

时间:2019-01-14 11:14:44

标签: php

我有这一行:

<input type="text" name="mpsRegnomer" er="невалиден номер" id="mpsRegnomer" class="upertrim inputGSmall" value="' . (isset($this->data['mpsRegnomer'])) ? '2' : '3' . '" style="margin-top:0px"/>

当我使用上面的这一行时,它返回值2

var_dump(isset($this->data['mpsRegnomer'])); exit;

它返回我bool(false)吗?根据文档,它应该返回3而不是2吗?

0 个答案:

没有答案