summaryrefslogtreecommitdiff
path: root/Zend/RFCs
diff options
context:
space:
mode:
authorSebastian Bergmann <sebastian@php.net>2002-06-11 08:06:02 +0000
committerSebastian Bergmann <sebastian@php.net>2002-06-11 08:06:02 +0000
commit1d6686c93603213aca0f0f3664639df54125ec45 (patch)
tree44d88d15fe18d0e716be06d35c12aaaace2a0bf8 /Zend/RFCs
parentc6a36d585bd6a7508e8f8722d044454fe3cceea4 (diff)
downloadphp-git-1d6686c93603213aca0f0f3664639df54125ec45.tar.gz
Add __delegate().
Diffstat (limited to 'Zend/RFCs')
-rw-r--r--Zend/RFCs/004.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/Zend/RFCs/004.txt b/Zend/RFCs/004.txt
index 6d973698ef..1e120ce306 100644
--- a/Zend/RFCs/004.txt
+++ b/Zend/RFCs/004.txt
@@ -74,3 +74,34 @@ Fixed Delegation
where locally defined or inherited from a superclass. The difference
to the dynamic delegation is that once the delegatee object is set,
it cannot be changed.
+
+
+Default Delegation
+
+ Syntax / Example
+
+ <?php
+ class Foo {
+ function __delegate($name, $parameters = array()) {
+ echo $name;
+ }
+ }
+
+ $foo = new Foo;
+ $foo->bar(); /* prints "bar" */
+ ?>
+
+ Semantics / Synopsis
+
+ If a class has a __delegate() method, it is called whenever a
+ method on an object of this class is called that is
+
+ * Not defined in the class.
+
+ * Not provided by a delegatee object.
+
+ The __delegate() method is called with the name and parameters
+ of the method call.
+
+ This supersedes / obsoletes similar functionality introduced in
+ Zend Engine 1 by ext/overload.