cvs: phpdoc /en/language types.xml

From: Date: Thu, 24 Jan 2008 17:46:12 +0000
Subject: cvs: phpdoc /en/language types.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-1077@lists.php.net to get a copy of this message
felipe Thu Jan 24 17:46:12 2008 UTC Modified files: /phpdoc/en/language types.xml Log: Add new example ("class::method" as valid callback) http://cvs.php.net/viewvc.cgi/phpdoc/en/language/types.xml?r1=1.193&r2=1.194&diff_format=u Index: phpdoc/en/language/types.xml diff -u phpdoc/en/language/types.xml:1.193 phpdoc/en/language/types.xml:1.194 --- phpdoc/en/language/types.xml:1.193 Thu Jan 10 16:09:42 2008 +++ phpdoc/en/language/types.xml Thu Jan 24 17:46:12 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.193 $ --> +<!-- $Revision: 1.194 $ --> <chapter xml:id="language.types" xmlns="http://docbook.org/ns/docbook"> <title>Types</title> @@ -2417,6 +2417,7 @@ <programlisting role="php"> <![CDATA[ <?php + // An example callback function function my_callback_function() { echo 'hello world!'; @@ -2424,7 +2425,7 @@ // An example callback method class MyClass { - function myCallbackMethod() { + static function myCallbackMethod() { echo 'Hello World!'; } } @@ -2438,6 +2439,10 @@ // Type 3: Object method call $obj = new MyClass(); call_user_func(array($obj, 'myCallbackMethod')); + +// Type 4: Static class method call (As of PHP 5.2.3) +call_user_func('MyClass::myCallbackMethod'); + ?> ]]> </programlisting>

« previous php.doc.cvs (#1077) next »