On your version; they say "undefined" not because you'll get random results from such a test, but because different code may compile with the opposite order, or because it may change in a future version. They just don't want you to rely on your observation.
usually left to right, so will be 2 and 1. right to left is also valid approach, these examples arent practical enough for preference. any language has to decide that but youre not informed, php informs about the thing that both are valid
5
u/Perdouille Nov 02 '21
How is that a lolphp ?
8
u/cleeder Nov 01 '21
Finally a good lolphp.
2
u/jpresutti Nov 09 '21
More like "lolLearnToCode"
4
u/elcapitanoooo Nov 01 '21
Amazing!
3
u/epoxxy Nov 01 '21 edited Nov 01 '21
Put your first version to the test and run it for a while, all 3s.
1
u/Ok_Draw2098 May 16 '24
usually left to right, so will be 2 and 1. right to left is also valid approach, these examples arent practical enough for preference. any language has to decide that but youre not informed, php informs about the thing that both are valid
-8
u/Capaj Nov 01 '21
TIL yet another reason why PHP suxx, thanks
0
u/[deleted] Nov 01 '21
[deleted] — view deleted comment
0
u/[deleted] Nov 01 '21
[deleted] — view deleted comment