> That's the way the language designers did it, and there's LOTS of > PRODUCTION code out > there that uses it. > > See also the precedence of PERL.
Well, perl and PHP use the $ for slightly different reasons, it seems. In perl, the *thing* in front of a variable name ($, @, %) indicates what context the variable is being used in (scalar, list, hash). Depending on what you want your variable to do, using a different character makes all the difference. The leading character is not a part of the variable name. PHP seems to use the $ more for readability, and possibly for making the language easier to parse (and, of course, the aforementioned string-embedding). Since all variable types (scalars, arrays, objects) seem to use the $, it seems more for syntactic uses and less as something that changes how the object behaves. However, I like having it there. It (as someone else mentioned) helps me quickly see where variables are used, both in and out of strings. It also probably helps syntax-highlighting text editors read the code more quickly, although it may be just as easy without. All I know is when I think back to programming C++, I can't imagine how I could deal with variables that didn't have something in front of them to separate them from barewords. Oh well. -- [ joel boonstra | [EMAIL PROTECTED] ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php