mirror of
https://github.com/php/doc-en.git
synced 2026-03-24 15:52:15 +01:00
103 lines
2.4 KiB
XML
103 lines
2.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<refentry xml:id="reflectionmethod.createfrommethodname" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>ReflectionMethod::createFromMethodName</refname>
|
|
<refpurpose>Creates a new ReflectionMethod</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="ReflectionMethod">
|
|
<modifier>public</modifier> <modifier>static</modifier> <type>static</type><methodname>ReflectionMethod::createFromMethodName</methodname>
|
|
<methodparam><type>string</type><parameter>method</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Creates a new <classname>ReflectionMethod</classname>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>method</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Class name and method name delimited by <literal>::</literal>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns a new <classname>ReflectionMethod</classname> on success.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
A <classname>ReflectionException</classname> is thrown if the given method does not exist.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title><methodname>ReflectionMethod::createFromMethodName</methodname> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
class Foo {
|
|
public function bar() {
|
|
|
|
}
|
|
}
|
|
|
|
$methodInfo = ReflectionMethod::createFromMethodName("Foo::bar");
|
|
var_dump($methodInfo);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
object(ReflectionMethod)#1 (2) {
|
|
["name"]=>
|
|
string(3) "bar"
|
|
["class"]=>
|
|
string(3) "Foo"
|
|
}
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</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
|
|
-->
|