diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-14 12:42:35 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-14 12:42:35 +0100 |
commit | 1f1a0fa9349d37e623ae763b48c7ea21681cd45b (patch) | |
tree | d5bc49690b2bb1f85f3560c28845dcc02566d330 /documentation | |
parent | 91e1175a467cb9e2f90e7421a1398430d075f776 (diff) |
implementation of properties using callback methods
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/magic-methods.html | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/documentation/magic-methods.html b/documentation/magic-methods.html index 2b40273..9294a3e 100644 --- a/documentation/magic-methods.html +++ b/documentation/magic-methods.html @@ -12,8 +12,8 @@ </p> <h2 id="compile-time-detection">Compile time detection</h2> <p> - Although you may think that the magic methods are virtual methods that - are overridden from the Php::Base class, they are not. The methods are + Although you may have expected that the magic methods are virtual methods in + the Php::Base class that can be overridden, they are not. The methods are detected by the C++ compiler at compile time - and are very normal methods that just happen to have a certain name. </p> @@ -46,18 +46,18 @@ The only exception to this rule is the __construct() method. This method does have to be explicitly registered. There are a number of reasons for this. For a start, the __construct() method does not have a fixed signature, and - by explicitly adding it to the extension, you can also exactly specify what - parameters it accepts, and whether the __construct() method should be + by explicitly adding it to the extension, you can also specify what + parameters it accepts, and whether the __construct() method should be public, private or protected (if you want to create classes that can not be instantiated from PHP). </p> <p> The other reason why you have to explicitly register the __construct() method, - is that, unlike other magic methods, the magic __construct method <i>must</i> + is that, unlike other magic methods, the __construct method <i>must</i> be visible from PHP. Inside constructors of derived classes, it often is necessary to make a call to parent::__construct(). By registering the __construct() method in the get_module() function you make the function - visible from PHP, which makes constructs like this possible. + visible from PHP. </p> <p> We have a special article about <a href="constructors-and-destructors"> @@ -72,12 +72,12 @@ the object gets destructed (and the C++ destructor runs). </p> <p> - The __clone() and __destruct() methods are regular magic methods. You do - not have to register them to make them active. The PHP-CPP library calls - them automatically if they are available. + The __clone() and __destruct() methods are regular magic methods and you + therefore do not have to register them to make them active. The PHP-CPP + library calls them automatically if they are available. </p> <p> - In normal circumstances you probably do not need these methods very often. + In normal circumstances you probably have not need for these methods. The C++ copy constructor and the C++ destructor can be used too. The only difference is that the magic methods are called on objects that are in a fully initialized state, while the C++ copy constructor and C++ destructor @@ -85,8 +85,8 @@ <i>being destructed</i>. </p> <p> - The article about <a href="constructors-and-destructors">mentioned above</a> - as more details and examples. + The article about mentioned above about <a href="constructors-and-destructors"> + constructors and destructors</a> has more details and examples. </p> <h2 id="pseudo-properties">Pseudo properties</h2> <p> |