Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions reference/reflection/reflectionmethod/createfrommethodname.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?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
-->
1 change: 1 addition & 0 deletions reference/reflection/versions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
<function name="reflectionmethod::__clone" from="PHP 5, PHP 7, PHP 8"/>
<function name="reflectionmethod::__construct" from="PHP 5, PHP 7, PHP 8"/>
<function name="reflectionmethod::__tostring" from="PHP 5, PHP 7, PHP 8"/>
<function name="reflectionmethod::createfrommethodname" from="PHP 8 &gt;= 8.3.0"/>
<function name="reflectionmethod::export" from="PHP 5, PHP 7" deprecated="PHP 7.4.0" removed="PHP 8"/>
<function name="reflectionmethod::isgenerator" from="PHP 5 &gt;= 5.5.0, PHP 7, PHP 8"/>
<function name="reflectionmethod::ispublic" from="PHP 5, PHP 7, PHP 8"/>
Expand Down