Torben was quicker :) and forestalled me

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@72891 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Gyozo Papp 2002-03-12 11:14:37 +00:00
parent f790205618
commit 5204bd8fc9

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.35 $ -->
<!-- $Revision: 1.36 $ -->
<reference id="ref.classobj">
<title>Class/Object Functions</title>
<titleabbrev>Classes/Objects</titleabbrev>
@ -170,45 +170,11 @@ Object leafy belongs to class spinach a subclass of Vegetable
</sect1>
</partintro>
<refentry id="function.call-user-method-array">
<refnamediv>
<refname>call_user_method_array</refname>
<refpurpose>
Call a user method given with an array of parameters
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>call_user_method_array</methodname>
<methodparam><type>string</type><parameter>method_name</parameter></methodparam>
<methodparam><type>object</type><parameter>obj</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>paramarr</parameter></methodparam>
</methodsynopsis>
<para>
Calls a the method referred by <parameter>method_name</parameter> from
the user defined <parameter>obj</parameter> object, using the parameters
in <parameter>paramarr</parameter>.
</para>
<para>
See also:
<function>call_user_func_array</function>,
<function>call_user_func</function>,
<function>call_user_method</function>.
</para>
<note>
<para>
This function was added to the CVS code after release of PHP 4.0.4pl1
</para>
</note>
</refsect1>
</refentry>
<refentry id="function.call-user-method">
<refnamediv>
<refname>call_user_method</refname>
<refpurpose>
Call a user method on an specific object
Call a user method on an specific object [deprecated]
</refpurpose>
</refnamediv>
<refsect1>
@ -220,6 +186,13 @@ Object leafy belongs to class spinach a subclass of Vegetable
<methodparam choice="opt"><type>mixed</type><parameter>parameter</parameter></methodparam>
<methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam>
</methodsynopsis>
<warning>
<para>
The <function>call_user_method</function> function is deprecated
as of PHP 4.1.0, use the <function>call_user_func</function> variety
with the <literal>array(&$obj, "method_name")</literal> syntax instead.
</para>
</warning>
<para>
Calls a the method referred by <parameter>method_name</parameter> from
the user defined <parameter>obj</parameter> object. An example of usage
@ -259,12 +232,53 @@ call_user_method ("print_info", $cntry, "\t");
</para>
<simpara>
See also <function>call_user_func_array</function>,
<function>call_user_func</function>,
<function>call_user_func</function>, and
<function>call_user_method_array</function>.
</simpara>
</refsect1>
</refentry>
<refentry id="function.call-user-method-array">
<refnamediv>
<refname>call_user_method_array</refname>
<refpurpose>
Call a user method given with an array of parameters [deprecated]
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>mixed</type><methodname>call_user_method_array</methodname>
<methodparam><type>string</type><parameter>method_name</parameter></methodparam>
<methodparam><type>object</type><parameter>obj</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>paramarr</parameter></methodparam>
</methodsynopsis>
<warning>
<para>
The <function>call_user_method_array</function> function is deprecated
as of PHP 4.1.0, use the <function>call_user_func_array</function> variety
with the <literal>array(&$obj, "method_name")</literal> syntax instead.
</para>
</warning>
<para>
Calls a the method referred by <parameter>method_name</parameter> from
the user defined <parameter>obj</parameter> object, using the parameters
in <parameter>paramarr</parameter>.
</para>
<para>
See also:
<function>call_user_func_array</function>,
<function>call_user_func</function>,
<function>call_user_method</function>.
</para>
<note>
<para>
This function was added to the CVS code after release of PHP 4.0.4pl1
</para>
</note>
</refsect1>
</refentry>
<refentry id="function.class-exists">
<refnamediv>
<refname>class_exists</refname>
@ -309,8 +323,8 @@ call_user_method ("print_info", $cntry, "\t");
</note>
<simpara>
See also <function>get_parent_class</function>,
<function>get_type</function>, and
<function>is_subclass_of</function>
<function>gettype</function>, and
<function>is_subclass_of</function>.
</simpara>
</refsect1>
</refentry>
@ -324,7 +338,7 @@ call_user_method ("print_info", $cntry, "\t");
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>get_class_methods</methodname>
<methodparam><type>string</type><parameter>class_name</parameter></methodparam>
<methodparam><type>mixed</type><parameter>class_name</parameter></methodparam>
</methodsynopsis>
<para>
This function returns an array of method names defined for the
@ -337,7 +351,7 @@ call_user_method ("print_info", $cntry, "\t");
<informalexample>
<programlisting>
<![CDATA[
$class_methods = get_class_methods($my_class);
$class_methods = get_class_methods($my_class); // see below the full example
]]>
</programlisting>
</informalexample>
@ -367,9 +381,9 @@ class myclass {
}
}
$my_class = new myclass();
$my_object = new myclass();
$class_methods = get_class_methods(get_class($my_class));
$class_methods = get_class_methods(get_class($my_object));
foreach ($class_methods as $method_name) {
echo "$method_name\n";
@ -393,8 +407,8 @@ myfunc2
</informalexample>
</para>
<simpara>
See also <function>get_class_vars</function>,
<function>get_object_vars</function>
See also <function>get_class_vars</function> and
<function>get_object_vars</function>.
</simpara>
</refsect1>
</refentry>
@ -553,32 +567,38 @@ class Point2D {
}
}
// "$label" is declared but not defined
$p1 = new Point2D(1.233, 3.445);
print_r(get_object_vars($p1));
// "$label" is declared but not defined
// Array
// (
// [x] => 1.233
// [y] => 3.445
// )
$p1->setLabel("point #1");
print_r(get_object_vars($p1));
// Array
// (
// [x] => 1.233
// [y] => 3.445
// [label] => point #1
// )
?>
]]>
</programlisting>
</example>
The printout of the above program will be:
<screen>
<![CDATA[
Array
(
[x] => 1.233
[y] => 3.445
)
Array
(
[x] => 1.233
[y] => 3.445
[label] => point #1
)
]]>
</screen>
</para>
<simpara>
See also <function>get_class_methods</function>,
<function>get_class_vars</function>
See also <function>get_class_methods</function> and
<function>get_class_vars</function>!
</simpara>
</refsect1>
</refentry>
@ -632,7 +652,7 @@ print_r(get_object_vars($p1));
</para>
<simpara>
See also <function>get_class</function>,
<function>get_parent_class</function> and
<function>get_parent_class</function>, and
<function>is_subclass_of</function>.
</simpara>
</refsect1>