PHP. Руководство по PHP. 2005
VisibilityПред.
Visibility
The visibility of a property or method can be defined by prefixing the declaration with the keywords: public, protected or private. Public declared items can be accessed everywhere. Protected limits access to inherited classes (and to the class that defines the item). Private limits visibility only to the class that defines the item.
Members Visibility
Class members must be defined with public, private, or protected.
Замечание: The PHP4 method of declaring a variable with the var keyword is no longer valid for PHP 5 objects. For compatibility a variable declared in php will be assumed with public visibility, and a E_STRICT warning will be issued.
Method Visibility
Class methods must be defined with public, private, or protected. Methods without any declaration are defined as public.
Пример 19-9. Method Declaration
|
Конструкторы и деструкторы
Отвечу на любые вопросы. С уважением, Дмитрий Владимирович.
⇪