![]() |
PHP, {}, and ";" after them
Hello. In C++ (AFAIK) after "if {...}" you also should add ";". But after this statement in PHP you don't have to (might look like negligence, which is so like PHP). But what is a better practice in PHP?
Code:
if (true)Code:
if (true) |
I'd go with whatever's valid syntax, being as it looks clear enough without the ;. In fact, I tend to comment something like } // end if describe condition in many languages.
If you don't like this PHP syntax quirk, you might hate Python ;) |
Quote:
|
Quote:
Here's C++ example: Code:
#ifndef __ADDRBAR_H |
Quote:
|
| All times are GMT -5. The time now is 05:03 PM. |