Re: Re: [PHP] What is a label?

From: Date: Wed, 13 Jul 2011 22:27:00 +0000
Subject: Re: Re: [PHP] What is a label?
Groups: php.general 
Request: Send a blank email to php-general+get-314044@lists.php.net to get a copy of this message
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

« previous php.general (#314044) next »