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