derick Fri Jun 20 02:55:47 2003 EDT Modified files: /phpdoc/en/language types.xml Log: - Use PEAR Coding Standards for OO examples Index: phpdoc/en/language/types.xml diff -u phpdoc/en/language/types.xml:1.120 phpdoc/en/language/types.xml:1.121 --- phpdoc/en/language/types.xml:1.120 Thu Jun 19 18:29:12 2003 +++ phpdoc/en/language/types.xml Fri Jun 20 02:55:46 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.120 $ --> +<!-- $Revision: 1.121 $ --> <chapter id="language.types"> <title>Types</title> @@ -2250,20 +2250,18 @@ call_user_func('my_callback_function'); // method callback examples -class my_class { - function my_callback_method() { - echo 'hello world!'; +class MyClass { + function myCallbackMethod() { + echo 'Hello World!'; } } // static class method call without instantiating an object -call_user_func(array('my_class', 'my_callback_method')); - -$obj = new my_class; - -call_user_func(array(&$obj, 'my_callback_method')); // object method call - +call_user_func(array('MyClass', 'myCallbackMethod')); +// object method call +$obj = new MyClass(); +call_user_func(array(&$obj, 'myCallbackMethod')); ?> ]]> </programlisting>
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php