php三元运算代码分析

来源:互联网 发布:下载九妖软件 编辑:程序博客网 时间:2024/05/18 02:52
$agent = $getagent ? $getagent : isset($this->input['agent']) ? $this->input['agent'] : '';

相当于

$agent = $getagent ? $getagent : (isset($this->input['agent']) ? $this->input['agent'] : '');

括号优先执行

原创粉丝点击