From: Andrei Zmievski Date: Fri, 7 Dec 2001 06:19:20 +0000 (+0000) Subject: All right, let people RTFM. X-Git-Tag: ChangeLog~98 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ec143228a7c5d8b13c0b36d9ca6a732bfa49ac6;p=php All right, let people RTFM. --- diff --git a/ext/overload/README b/ext/overload/README index 06c22ad89e..e6017fe408 100644 --- a/ext/overload/README +++ b/ext/overload/README @@ -16,10 +16,17 @@ properties normally. Usage ----- + 9, 'c' => 42); + function OO($aval = null) + { + $this->a = $aval; + } + function __get($prop_name, &$prop_value) { if (isset($this->elem[$prop_name])) { @@ -34,6 +41,20 @@ class OO { $this->elem[$prop_name] = $prop_value; return true; } + + function __call() + { + $args = func_get_args(); + $method = array_shift($args); + print '-- OO::' . $method . "() was called.--\n"; + return call_user_func_array(array(&$this, 'my_' . $method), $args); + } + + function my_whatever($f1, $f2, $f3) + { + var_dump($f1, $f2, $f3); + return $f1 + $f2; + } } overload('OO'); @@ -50,6 +71,9 @@ $val->prop = 555; $o->a = array($val); var_dump($o->a[0]->prop); +var_dump($o->whatever(1, 2, 'a')); + +?> What works ---------- @@ -58,15 +82,13 @@ Whatever you can get it to do. What doesn't work ----------------- -__call() support. Invoking original overloading handlers, if the class had any. __set() only works to one level of property access, no chains yet -Whatever I am forgetting about here. +Whatever else I am forgetting about here. What might change ----------------- -Hell, anything, even the name of extension and its function. - +Hell, anything, even the name of extension and its only function. Feedback, please. diff --git a/ext/overload/php_overload.h b/ext/overload/php_overload.h index 627f1ae9df..8b93452667 100644 --- a/ext/overload/php_overload.h +++ b/ext/overload/php_overload.h @@ -36,9 +36,6 @@ extern zend_module_entry overload_module_entry; #endif PHP_MINIT_FUNCTION(overload); -PHP_MSHUTDOWN_FUNCTION(overload); -PHP_RINIT_FUNCTION(overload); -PHP_RSHUTDOWN_FUNCTION(overload); PHP_MINFO_FUNCTION(overload); PHP_FUNCTION(overload);