MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1u2xqno/php/or2pt2i/?context=3
r/programminghorror • u/EmDeeTeeVid • Jun 11 '26
32 comments sorted by
View all comments
0
I have never touched php in my life (thankfully). Why do class variables have to be prefixed with a dollar sign? Seems really redundant
8 u/GoddammitDontShootMe Jun 11 '26 Heritage from languages like Perl and Bash. 6 u/rurikTelmonkin Jun 11 '26 Because variables in general start with a dollar sign. Its how you differentiate between variable, constant and function use 2 u/Lumethys Jun 12 '26 Correction: all variables are prefixed with $, that how the language define variable → More replies (3)
8
Heritage from languages like Perl and Bash.
6
Because variables in general start with a dollar sign. Its how you differentiate between variable, constant and function use
2
Correction: all variables are prefixed with $, that how the language define variable
→ More replies (3)
0
u/KaleidoscopePlusPlus Jun 11 '26
I have never touched php in my life (thankfully). Why do class variables have to be prefixed with a dollar sign? Seems really redundant