Defining and Using Objects

The same naming requirements as those used with functions apply to objects. Object names in PHP must start with an alphabetical character or underscore and consist of only alphabetical characters, numbers, or underscores. Object names are global in scope and case insensitive, as are functions. Prior to PHP 5, you can only have one class definition per page. PHP 5 enables you to define multiple classes in a single program script, avoiding all that prior nonsense with one class per file and the __autoload function, which you used to put all class files into the working environment. That being said, if you like the one-class-per-file model, you can still use it by leveraging the __autoload function.

Scope for PHP classes ...

Get Oracle Database 10g Express Edition PHP Web Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.