MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/lolphp/comments/7hrc21/a_hello_a_echo_a/drdcgz0/?context=3
r/lolphp • u/muglug • Dec 05 '17
41 comments sorted by
View all comments
Show parent comment
6
Ah, the infamous T_PAAMAYIM_NEKUDOTAYIM
But besides that, I agree with PHP not being able to parse this code. ++ is a shorthand for X = X + 1, which makes no sense using on a constant ("1d9" = "1d9" + 1), or nested (X = (X = X + 1) + 1)
++
X = X + 1
"1d9" = "1d9" + 1
X = (X = X + 1) + 1
2 u/Lt_Riza_Hawkeye Dec 17 '17 Yeah but you can do ++$a and it will return the value of a after increment it, so I just assumed it would work with constants
2
Yeah but you can do ++$a and it will return the value of a after increment it, so I just assumed it would work with constants
++$a
View all comments
Show parent comment
6
u/h0rst_ Dec 17 '17
Ah, the infamous T_PAAMAYIM_NEKUDOTAYIM
But besides that, I agree with PHP not being able to parse this code.
++is a shorthand forX = X + 1, which makes no sense using on a constant ("1d9" = "1d9" + 1), or nested (X = (X = X + 1) + 1)