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.
Both method calls and member accesses can be overloaded via the __call, __get and __set methods. These methods will only be triggered when your object or inherited object doesn't contain the member or method you're trying to access. All overloading methods must not be defined as static. All overloading methods must be defined as public.
Since PHP 5.1.0 it is also possible to overload the isset() and unset() functions via the __isset and __unset methods respectively.
Class members can be overloaded to run custom code defined in your class
by defining these specially named methods. The $name
parameter used is the name of the variable that should be set or retrieved.
The __set() method's $value parameter specifies the
value that the object should set the $name.
The magic method __call() allows to capture invocation of non existing
methods. That way __call() can be used to implement user defined method
handling that depends on the name of the actual method being called. This
is for instance useful for proxy implementations. The arguments that were
passed in the function will be defined as an array in the
$arguments parameter. The value returned from the
__call() method will be returned to the caller of the method.
Przykład 19-21. overloading with __call example
Powyższy przykład wyświetli:
|
| Poprzedni | Spis treści | Następny |
| Object Interfaces | Początek rozdziału | Object Iteration |
php
kontakt:praca.pozycjonowanie@gmail.com