|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
rabol Smarty Rookie
Joined: 07 Jan 2004 Posts: 11
|
Posted: Wed Jan 07, 2004 12:19 pm Post subject: Configuration var names |
|
|
Hi
I a project that I'm working on I use the Config_File class to read language strings for my application.
Why can't I have var names starting with numbers ?
eg. 1_var = "test", gives this error:
Warning: Config_File error: Bad variable name '1_var' in c:\www\test\www\include\smarty\libs\Config_File.class.php on line 360
Thanks in advance.
Steen |
|
Back to top |
|
tk Smarty Regular
Joined: 31 Oct 2003 Posts: 49 Location: London, UK
|
Posted: Thu Jan 08, 2004 12:16 am Post subject: |
|
|
Isn't this the same for PHP and (most?) other languages too?
Hazarding a guess.. it's because $1 through $9 have special meanings.
FWIW, I get the same for Perl too:
Code: | [tk@hybris:~]$ perl -e '$1_var = "test"; print $1_var;'
Bareword found where operator expected at -e line 1, near "$1_var"
(Missing operator before _var?)
|
HTH =)
Regards,
tk _________________ Certified Code Junkie(tM)
Copyleft (L) two thousand and now, tk |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Jan 08, 2004 7:54 am Post subject: |
|
|
it's a common limititation to have to have identifiers start with a letter. most programming languages and a lot of file-formats do so. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|