rfc:array_count_handlers
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
rfc:array_count_handlers [2008/06/25 16:21] – created colder | rfc:array_count_handlers [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2008-06-25 | * Date: 2008-06-25 | ||
* Author: Etienne Kneuss < | * Author: Etienne Kneuss < | ||
- | * Status: | + | * Status: |
Line 9: | Line 9: | ||
An internal class has two ways to achieve a special feature: | An internal class has two ways to achieve a special feature: | ||
- | 1) implement the interface and define the method | + | |
- | 2) define the handler | + | |
+ | - define the handler | ||
for a class to be userland-friendly AND fast it must: | for a class to be userland-friendly AND fast it must: | ||
- | 1) define a zend_function pointer in the object for a specific method | + | |
- | 2) when creating the object, check if the method is overriden, if so, assign that pointer to the child method | + | - when creating the object, check if the method is overriden, if so, assign that pointer to the child method |
- | 3) define a handler that will check that pointer, if defined: call it, if not, proceed without any method call | + | - define a handler that will check that pointer, if defined: call it, if not, proceed without any method call |
- | ==== Problem with count_elements | + | ===== Proposal and Patch ===== |
There are one problem with how the count_elements handler is defined/ | There are one problem with how the count_elements handler is defined/ | ||
There are two main reasons why it's a problem: | There are two main reasons why it's a problem: | ||
- | 1) while it's userland friendly, it doesn' | + | |
- | 2) it's not consistent with other handlers | + | - it's not consistent with other handlers |
- | + | ||
- | ===== Proposal and Patch ===== | + | |
- | The patch consists of changing the order of the checks: | + | The patch consists of changing the order of the checks |
http:// | http:// | ||
+ | http:// | ||
===== Possible Breaks ===== | ===== Possible Breaks ===== |
rfc/array_count_handlers.1214410883.txt.gz · Last modified: 2017/09/22 13:28 (external edit)