rfc:propertygetsetsyntax-implementation-details
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:propertygetsetsyntax-implementation-details [2013/01/16 21:39] – Rewrite to current state cpriest | rfc:propertygetsetsyntax-implementation-details [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Internal Implementation Details for Property Accessors ====== | ====== Internal Implementation Details for Property Accessors ====== | ||
* Version: 1.2 | * Version: 1.2 | ||
- | * Updated: 2013-01-16 | + | * Updated: 2013-01-17 |
* Author: Clint Priest <phpdev at zerocue dot com> | * Author: Clint Priest <phpdev at zerocue dot com> | ||
* Contributors: | * Contributors: | ||
Line 43: | Line 43: | ||
</ | </ | ||
- | An additional byte was added to zend_function | + | The '' |
- | <code c> | + | |
- | zend_uchar purpose; | + | |
- | </ | + | |
- | + | ||
- | This was in lieu of using 4 additional fn_flag values for which there was not room. There are presently five states purpose can be in, they are: | + | |
- | <code c> | + | |
- | #define ZEND_FNP_UNDEFINED 0 / | + | |
- | #define ZEND_FNP_PROP_GETTER 1 / | + | |
- | #define ZEND_FNP_PROP_SETTER 2 / | + | |
- | #define ZEND_FNP_PROP_ISSETTER 3 / | + | |
- | #define ZEND_FNP_PROP_UNSETTER 4 / | + | |
- | </ | + | |
- | + | ||
- | All non-accessor functions | + | |
==== Compilation Changes ==== | ==== Compilation Changes ==== | ||
Line 73: | Line 59: | ||
the property and if so checks that there is an accessor for the specific action (read/ | the property and if so checks that there is an accessor for the specific action (read/ | ||
handles the situation accordingly. | handles the situation accordingly. | ||
+ | |||
Much of the pre/post magic call code that %%__get/ | Much of the pre/post magic call code that %%__get/ | ||
The new accessors also utilize these functions so that all pre/post condition handling is the same for accessors as they are for the magics. | The new accessors also utilize these functions so that all pre/post condition handling is the same for accessors as they are for the magics. | ||
- | At this time, accessors | + | |
- | a warning will be emitted if recursion is detected and that recursion is not called from the context of the accessor. | + | A new function flag was added '' |
+ | accessors | ||
+ | recursion is not called from the context of the validly scoped | ||
For example a get accessor is allowed to get it's own value and does not produce a warning, but instead the ordinary property access routines occur while attempts to read that property from a context other than the get accessor will emit a warning and the value will be returned as NULL. | For example a get accessor is allowed to get it's own value and does not produce a warning, but instead the ordinary property access routines occur while attempts to read that property from a context other than the get accessor will emit a warning and the value will be returned as NULL. | ||
+ | |||
* Error producing lines have been modified to produce a useful error report. | * Error producing lines have been modified to produce a useful error report. |
rfc/propertygetsetsyntax-implementation-details.1358372390.txt.gz · Last modified: 2017/09/22 13:28 (external edit)