<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Returns the string representation of the Reflection method object.</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="reflectionmethod.setaccessible.html">ReflectionMethod::setAccessible</a></div> <div class="next" style="text-align: right; float: right;"><a href="class.reflectionobject.html">ReflectionObject</a></div> <div class="up"><a href="class.reflectionmethod.html">ReflectionMethod</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="reflectionmethod.tostring" class="refentry"> <div class="refnamediv"> <h1 class="refname">ReflectionMethod::__toString</h1> <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">ReflectionMethod::__toString</span> — <span class="dc-title">Returns the string representation of the Reflection method object.</span></p> </div> <div class="refsect1 description" id="refsect1-reflectionmethod.tostring-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">string</span> <span class="methodname"><strong>ReflectionMethod::__toString</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> Returns the string representation of the Reflection method object. </p> </div> <div class="refsect1 parameters" id="refsect1-reflectionmethod.tostring-parameters"> <h3 class="title">Parameters</h3> <p class="para">This function has no parameters.</p> </div> <div class="refsect1 returnvalues" id="refsect1-reflectionmethod.tostring-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> A string representation of this <a href="class.reflectionmethod.html" class="classname">ReflectionMethod</a> instance. </p> </div> <div class="refsect1 examples" id="refsect1-reflectionmethod.tostring-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-5235"> <p><strong>Example #1 <span class="methodname"><strong>ReflectionMethod::__toString()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /></span><span style="color: #007700">class </span><span style="color: #0000BB">HelloWorld </span><span style="color: #007700">{<br /><br /> public function </span><span style="color: #0000BB">sayHelloTo</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">) {<br /> return </span><span style="color: #DD0000">'Hello ' </span><span style="color: #007700">. </span><span style="color: #0000BB">$name</span><span style="color: #007700">;<br /> }<br /><br />}<br /><br /></span><span style="color: #0000BB">$reflectionMethod </span><span style="color: #007700">= new </span><span style="color: #0000BB">ReflectionMethod</span><span style="color: #007700">(new </span><span style="color: #0000BB">HelloWorld</span><span style="color: #007700">(), </span><span style="color: #DD0000">'sayHelloTo'</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">$reflectionMethod</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> Method [ <user> public method sayHelloTo ] { @@ /var/www/examples/reflection.php 16 - 18 - Parameters [1] { Parameter #0 [ <required> $name ] } } </pre></div> </div> </div> </p> </div> <div class="refsect1 seealso" id="refsect1-reflectionmethod.tostring-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="methodname"><a href="reflectionmethod.export.html" class="methodname" rel="rdfs-seeAlso">ReflectionMethod::export()</a> - Export a reflection method.</span></li> <li class="member"><a href="language.oop5.magic.html#object.tostring" class="link">__toString()</a></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="reflectionmethod.setaccessible.html">ReflectionMethod::setAccessible</a></div> <div class="next" style="text-align: right; float: right;"><a href="class.reflectionobject.html">ReflectionObject</a></div> <div class="up"><a href="class.reflectionmethod.html">ReflectionMethod</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>