Krok po koroku, pełna dokumentacja w języku polskim. Skrypty napisane w PHP są z reguły umieszczane w dokumentach tekstowych (często razem z HTML lub XHTML). Dzięki temu PHP jest podobny w założeniach do dużo starszego mechanizmu Server Side Includes[4]. PHP pozwala także na wykonywanie skryptów z linii poleceń podobnie jak Perl i Python. Jego modułowa budowa udostępnia również możliwość programowania aplikacji z interfejsem graficznym. PHP umożliwia współpracę z wieloma rodzajami źródeł danych, jak na przykład serwery relacyjnych baz danych, pliki tekstowe czy dokumenty XML.
Declaring class members or methods as static makes them accessible without needing an instantiation of the class. A member declared as static can not be accessed with an instantiated class object (though a static method can).
The static declaration must be after the visibility declaration. For compatibility with PHP 4, if no visibility declaration is used, then the member or method will be treated as if it was declared as public.
Because static methods are callable without an instance of
the object created, the pseudo variable $this is
not available inside the method declared as static.
In fact static method calls are resolved at compile time. When using an explicit class name the method is already identified completely and no inheritance rules apply. If the call is done by self then self is translated to the current class, that is the class the code belongs to. Here also no inheritance rules apply.
Static properties cannot be accessed through the object using the arrow operator ->.
Calling non-static methods statically generates an E_STRICT level warning.
| Poprzedni | Spis treści | Następny |
| Scope Resolution Operator (::) | Początek rozdziału | Class Constants |
php
kontakt:praca.pozycjonowanie@gmail.com