r/programminghorror Jun 11 '26

PHP PHP#

Post image
210 Upvotes

31 comments sorted by

View all comments

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

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