PHP Velho Oeste 2024

소개

모든 PHP 스크립트는 연속적인 구문으로 이루어진다. 하나의 구문은 지정문 이 될수도 있고, 함수 호출, 반복문, 조건문이 될수 있으며 심지어는 아무 내용이 없는 빈 문장일수도 있다. 한 구문은 보통 세미콜론(;)으로 끝난다. 또한 여러개의 구문을 중괄호({,})를 사용하여 하나의 그룹으로 만들어 사용할 수도 있다. 이 구문 그룹은 그 그룹의 모든 구문들이 하나의 구문인 것처럼 인식된다. 이 장에서는 여러 가지 구문형태에 대해 알아본다.

add a note add a note

User Contributed Notes 1 note

up
-3
Hayley Watson
3 years ago
Statements "usually" end with a semicolon. In particular, statements that are statement-groups end with the "}", and a closing "?>" is also enough to end a statement (and turn off parsing, of course).

Writing "};" is wrong and can lead to bugs because now there's one of those "empty" statements in there that could potentially mess with control flow.
To Top