ch05 / exam05-12.php

논리 연산자 우선순위 함정(|| vs or) 시각화

=(대입)보다 높은 ||/&& vs =보다 낮은 or/and의 파싱 차이

PHP Source (ch05/exam05-12.php)
단계: 0 / 0
1-7<!DOCTYPE html> <html> ... <body>
8<?php
9$a = false || true; // $a = (false || true) => true
10$b = false or true; // ($b = false) or true => false! ★
14$c = true && false; // $c = (true && false) => false
15$d = true and false; // ($d = true) and false => true! ★
18?>
19-20</body> </html>
준비 완료 실행 버튼 또는 다음 단계를 눌러주세요.
PHP의 결정적 우선순위 함정 분석기
대기 중...
http://localhost/ch05/exam05-12.php

|| vs or, && vs and의 우선순위 서열