mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
- Use PEAR Coding Standards for OO examples
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@132591 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
22a94eefc4
commit
f0212d661c
1 changed files with 8 additions and 10 deletions
|
@ -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 @@ function my_callback_function() {
|
|||
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>
|
||||
|
|
Loading…
Reference in a new issue