Re: Re: [PHP] What is a label?
| From: | Steve Staples | Date: | Thu, 14 Jul 2011 12:37:09 +0000 |
| Subject: | Re: Re: [PHP] What is a label? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-314068@lists.php.net to get a copy of this message | ||
On Wed, 2011-07-13 at 23:27 +0100, Tim Streater wrote:
> On 13 Jul 2011 at 22:39, Micky Hulse <rgmicky@gmail.com> wrote:
>
> > They must mean labels as in "general naming convention rules for
> > programming"... Like not naming a variable/function "label" with a number
> > at
> > the front.
> >
> > Here's a page about variables:
> >
> > http://www.php.net/manual/en/language.variables.basics.php
> >
> > Variable names follow the same rules as other labels in PHP. A valid
> > variable name starts with a letter or underscore, followed by any
> > number of letters, numbers, or underscores. As a regular expression,
> > it would be expressed thus: '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
>
> Except that variables are case-sensitive whereas function names are not. And if there's
> going to be a formal or "programmatic" definition, then I think I'd prefer BNF to a
> regexp.
>
> --
> Cheers -- Tim
>
Isn't that statement a little misleading?
> A valid variable name starts with a letter or underscore
If I am not mistaken, $_1 is not a valid variable name.
Steve.