mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Fix example (add "static"); Add new example ("classname::method" as valid callback)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@251282 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
257c6a22dd
commit
15c3c8267e
1 changed files with 5 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.18 $ -->
|
||||
<!-- $Revision: 1.19 $ -->
|
||||
<refentry xml:id="function.call-user-func" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>call_user_func</refname>
|
||||
|
@ -124,8 +124,9 @@ call_user_func(array(__NAMESPACE__ .'::Foo', 'test')); // As of PHP 5.3.0
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
class myclass {
|
||||
function say_hello()
|
||||
static function say_hello()
|
||||
{
|
||||
echo "Hello!\n";
|
||||
}
|
||||
|
@ -134,6 +135,8 @@ class myclass {
|
|||
$classname = "myclass";
|
||||
|
||||
call_user_func(array($classname, 'say_hello'));
|
||||
call_user_func($classname .'::say_hello'); // As of 5.2.3
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
Loading…
Reference in a new issue