Home / Section index
 www.icosaedro.it 
PHPLint
Reference
Manual

Contents
Introduction
Basic features
Packages
Importing modules
Importing packages
Autoloading classes
Namespaces
Constants
Predefined constants
Global variables
Predefined superglobals
Types
Arrays
Type compatibility
Typecasting
Classes
Recursive declarations
Control structures
Definite assignment analysis
Functions
Errors
Exceptions
PHPLint's Std. Library
Documentator
Usage
How To...
(PHP4) Classes (PHP4)
(PHP4) Type conversion operators
Reserved keywords
To-do list
Memorandum
License
References
Syntax
<= (PHP4) Type conversion operatorsTo-do list =>

Contents of this chapter

    Reserved keywords

      PHP keywords

      PHPLint keywords

Reserved keywords

There are some differences on how PHP and PHPLint scan the source of a program. PHPLint behave much like a compiler would, first scanning the source in distinct symbols and keywords, then parsing the semantic of these symbols. Instead, the PHP interpreter act much like a scripting language would do, and some of the words that compose the source have a meaning that depend on the context.

PHP keywords

These keywords are reserved by the parser of the PHP code, and cannot be used for names of constants, variables, functions, classes, class constants, properties or methods.

FALSE NULL TRUE abstract and array as bool boolean break case catch class clone const continue declare default define die do double echo else elseif enddeclare endfor endforeach endif endswitch endwhile exit extends final float for foreach function global goto if implements include include_once instanceof int integer interface isset list namespace new object or parent print private protected public real require require_once return self static string switch throw trigger_error try use var while xor

This list of keywords is longer than that stated by the PHP manual. Moreover, variables, properties and methods cannot take the name of a keyword, also if this name might be valid for the PHP interpreter. For example, this code:

define('function', 'xxxx');

class string
{
    private $private = "yyyy";

    function int()
    {
        $private = $this->private;
    }
}

is valid for the PHP 5 interpreter, but it is not for PHPLint because the constant name function, the class name string, the property name $private, the function name int(), the variable name $var and the property ...->private are all reserved keywords. PHPLint will raise an error if a constant or variable name collide with a keyword, and a fatal error in all the other cases.

PHPLint keywords

These keywords are reserved by PHPLint when parsing the extended code inside the comments "/*. .*/":

abstract args array bool boolean class else end_if_php_ver extends final float forward if_php_ver_4 if_php_ver_5 implements int integer interface missing_break missing_default mixed namespace object parent pragma private protected public require_module resource return self static string throws unchecked void

Since the extended code can include the class names, class names cannot collide with these keywords.



<= (PHP4) Type conversion operatorsTo-do list =>

Umberto Salsi

Contact
Site map
Home / Section index