More specifically, 'empty' is a language construct and not a function.
Other constructs are unset, isset and, well, there are others :)  For
example:

  $arr = array('mysql_connect' => 'foo',
               'unset'         => 'bar',
               'empty'         => 'ooh');

  print $arr[mysql_connect]; // Not fatal, gives a Warning
  print $arr[unset];         // Fatal.
  print $arr[empty];         // Fatal.

Of course us good little boys and girls always surround our keys in quotes
so the following all work as expected:

 print $arr['mysql_connect'];
 print $arr['unset'];
 print $arr['empty'];

Not suggesting these names be used as array keys though :) Regarding
reserved words, they can be seen here:

  http://www.php.net/manual/en/reserved.php

Regards,
Philip Olson



On Wed, 31 Oct 2001, CC Zona wrote:

> In article <01A4B59FD1EBD311838100A0C98BE0D9AD5D91@chef>,
>  [EMAIL PROTECTED] (Kirk Johnson) wrote:
> 
> > The manual at http://www.php.net/manual/en/language.types.array.php mentions
> > that "empty" and "default" are "special keywords". Does anyone know of any
> > lists of PHP's predefined constants and keywords? I'm not having any luck
> > finding them.
> 
> The chapter on variables has a page devoted to predefined vars; the 
> predefined constants list is likewise under the constants chapter.  I 
> suspect that the caution on the arrays page may refer to the fact that 
> "empty" is a function name and the "default" keyword is used by the switch 
> control structure.
> 
> -- 
> CC
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to