Take a look at the topic first
echo ' 1 '. Print (2) +3;
The correct result should be
511 for this answer, I say "! @##¥%¥% ... ", there is no way the answer is true.
So let's analyze why this is the answer, as the title says, this is a priority PHP topic for a pit dad, and that's an analysis of priority thinking (back-pushing).
1. Execute Print First
Print (2) +3;//is equivalent to print (2+3), at which point the buffer output is 5. Don't ask me why, the manual says.
2, print is a function, there are return results, int type
Print (5);//The result equals 1, this time echo ' 1 '. 1, at which point the buffer output 11
3, the final result (in order of output): 511
Add some knowledge about PHP priority:
Operator Precedence
The following table lists the precedence of operators from low to high.
Combining directional operators
Left
Left or
Left XOR
Left and
Right print
right = = = = *=/=. =%= &= |= ^= ~= <<=->>=
Left? :
Left | |
Left &&
Combining directional operators
Left |
Left ^
Left &
No = =!= = =!==
No < <= > >=
Left << >>
Left +-.
Left */%
Right! ~ + +-(int) (float) (string) (array) (object) @
Right
No new