mirror of
https://github.com/php/doc-ja.git
synced 2026-03-24 15:12:22 +01:00
164 lines
4.2 KiB
XML
164 lines
4.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: ec2fe9a592f794978114ef5021db9f1d00c2e05d Maintainer: takagi Status: ready -->
|
|
|
|
<refentry xml:id="reflectionmethod.invokeargs" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>ReflectionMethod::invokeArgs</refname>
|
|
<refpurpose>実行する</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="ReflectionMethod">
|
|
<modifier>public</modifier> <type>mixed</type><methodname>ReflectionMethod::invokeArgs</methodname>
|
|
<methodparam><type class="union"><type>object</type><type>null</type></type><parameter>object</parameter></methodparam>
|
|
<methodparam><type>array</type><parameter>args</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
リフレクション対象のメソッドを実行し、その引数を配列として渡します。
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>object</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
メソッドを実行するオブジェクト。staticメソッドを実行する場合は、このパラメータには
|
|
<type>null</type> を渡すことができます。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>args</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
メソッドに渡すパラメータを配列で指定します。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
メソッドの結果を返します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
メソッドが宣言されているクラスのインスタンス以外を <parameter>object</parameter>
|
|
パラメータで指定すると <classname>ReflectionException</classname> が発生します。
|
|
</para>
|
|
<para>
|
|
メソッドの実行に失敗すると <classname>ReflectionException</classname> が発生します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
<parameter>args</parameter> のキーは、
|
|
静かに無視されるのではなく、パラメータの名前として解釈されるようになりました。
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><methodname>ReflectionMethod::invokeArgs</methodname> の例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
class HelloWorld {
|
|
|
|
public function sayHelloTo($name) {
|
|
return 'Hello ' . $name;
|
|
}
|
|
|
|
}
|
|
|
|
$reflectionMethod = new ReflectionMethod('HelloWorld', 'sayHelloTo');
|
|
echo $reflectionMethod->invokeArgs(new HelloWorld(), array('Mike'));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Hello Mike
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
&reflection.invoke.reference;
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><methodname>ReflectionMethod::invoke</methodname></member>
|
|
<member><link linkend="object.invoke">__invoke()</link></member>
|
|
<member><function>call_user_func_array</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|