php逻辑运算深入(或)

<?php
    /* 两种或运算符比较 */
    $result1 = false || true;
    $result2 = false or true;
    var_dump($result1);        // boolean true
    var_dump($result2);        // boolean false
?>
or 运算符的优先级比 = 低,
实际执行:false赋值给$result2,然后$result2与true执行或运算

 

posted on 2013-04-01 18:04  刘宝成  阅读(130)  评论(0编辑  收藏  举报

导航