<!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>Get the type hinted class</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="reflectionparameter.export.html">ReflectionParameter::export</a></div> <div class="next" style="text-align: right; float: right;"><a href="reflectionparameter.getdeclaringclass.html">ReflectionParameter::getDeclaringClass</a></div> <div class="up"><a href="class.reflectionparameter.html">ReflectionParameter</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="reflectionparameter.getclass" class="refentry"> <div class="refnamediv"> <h1 class="refname">ReflectionParameter::getClass</h1> <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">ReflectionParameter::getClass</span> — <span class="dc-title">Get the type hinted class</span></p> </div> <div class="refsect1 description" id="refsect1-reflectionparameter.getclass-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type"><a href="class.reflectionclass.html" class="type ReflectionClass">ReflectionClass</a></span> <span class="methodname"><strong>ReflectionParameter::getClass</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> Gets the class type hinted for the parameter as a <a href="class.reflectionclass.html" class="classname">ReflectionClass</a> object. </p> <div class="warning"><strong class="warning">Warning</strong><p class="simpara">This function is currently not documented; only its argument list is available. </p></div> </div> <div class="refsect1 parameters" id="refsect1-reflectionparameter.getclass-parameters"> <h3 class="title">Parameters</h3> <p class="para">This function has no parameters.</p> </div> <div class="refsect1 returnvalues" id="refsect1-reflectionparameter.getclass-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> A <a href="class.reflectionclass.html" class="classname">ReflectionClass</a> object. </p> </div> <div class="refsect1 examples" id="refsect1-reflectionparameter.getclass-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-5237"> <p><strong>Example #1 Using the <a href="class.reflectionparameter.html" class="classname">ReflectionParameter</a> class</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">function </span><span style="color: #0000BB">foo</span><span style="color: #007700">(</span><span style="color: #0000BB">Exception $a</span><span style="color: #007700">) { }<br /><br /></span><span style="color: #0000BB">$functionReflection </span><span style="color: #007700">= new </span><span style="color: #0000BB">ReflectionFunction</span><span style="color: #007700">(</span><span style="color: #DD0000">'foo'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$parameters </span><span style="color: #007700">= </span><span style="color: #0000BB">$functionReflection</span><span style="color: #007700">-></span><span style="color: #0000BB">getParameters</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$aParameter </span><span style="color: #007700">= </span><span style="color: #0000BB">$parameters</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">];<br /><br />echo </span><span style="color: #0000BB">$aParameter</span><span style="color: #007700">-></span><span style="color: #0000BB">getClass</span><span style="color: #007700">()-></span><span style="color: #0000BB">name</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> Exception </pre></div> </div> </div> </p> </div> <div class="refsect1 seealso" id="refsect1-reflectionparameter.getclass-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="methodname"><a href="reflectionparameter.getdeclaringclass.html" class="methodname" rel="rdfs-seeAlso">ReflectionParameter::getDeclaringClass()</a> - Gets declaring class</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="reflectionparameter.export.html">ReflectionParameter::export</a></div> <div class="next" style="text-align: right; float: right;"><a href="reflectionparameter.getdeclaringclass.html">ReflectionParameter::getDeclaringClass</a></div> <div class="up"><a href="class.reflectionparameter.html">ReflectionParameter</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>