Internally, PHP never tells developers how they should write their PHP code. For example, Python uses indentation to indicate a block of code, while for other programming languages such as PHP and JavaScript, indentation in code is done for readability. The following is an example of what Python will accept:
age = 20
if age == 20:
print("age is 20")
Python will return an error if there's no indentation:
if age == 20:
print("age is 20")
The number of spaces is up to the coder's preference, but you must use at least one and have the same number of spaces for other lines in the same block; otherwise, Python will return an error:
if age == 20:
print("age is 20")
print("age is 20")
On the other hand, in PHP, you can write the following:
if (age == 20) {
print("age is 20");
}
The following is valid in PHP too:
if (age == 20) {
print("age is 20");
print("age is 20");
}
Python internally enforces readability...