downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the Git repository for this website on git.php.net.

Source of: /manual/en/reflectionclass.export.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/class.reflectionclass.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'reflectionclass.export.php',
   
1 => 'ReflectionClass::export',
  ),
 
'up' =>
  array (
   
0 => 'class.reflectionclass.php',
   
1 => 'ReflectionClass',
  ),
 
'prev' =>
  array (
   
0 => 'reflectionclass.construct.php',
   
1 => 'ReflectionClass::__construct',
  ),
 
'next' =>
  array (
   
0 => 'reflectionclass.getconstant.php',
   
1 => 'ReflectionClass::getConstant',
  ),
 
'alternatives' =>
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="reflectionclass.export" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ReflectionClass::export</h1>
  <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">ReflectionClass::export</span> &mdash; <span class="dc-title">Exports a class</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-reflectionclass.export-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">string</span> <span class="methodname"><strong>ReflectionClass::export</strong></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.php#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$argument</code></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$return</code><span class="initializer"> = false</span></span>
  ] )</div>

  <p class="para rdfs-comment">
   Exports a reflected class.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-reflectionclass.export-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">argument</code></em></span>
     <dd>

      <p class="para">
       The reflection to export.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">return</code></em></span>
     <dd>

      <p class="para">
       Setting to <strong><code>TRUE</code></strong> will return the export,
as opposed to emitting it. Setting to <strong><code>FALSE</code></strong> (the default) will do the opposite.
      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-reflectionclass.export-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   If the <em><code class="parameter">return</code></em> parameter
is set to <strong><code>TRUE</code></strong>, then the export is returned as a <span class="type"><a href="language.types.string.php" class="type string">string</a></span>,
otherwise <strong><code>NULL</code></strong> is returned.
  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-reflectionclass.export-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-5059">
    <p><strong>Example #1 Basic usage of  <span class="methodname"><strong>ReflectionClass::export()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">Apple&nbsp;</span><span style="color: #007700">{<br />&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;</span><span style="color: #0000BB">$var1</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;</span><span style="color: #0000BB">$var2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'Orange'</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;</span><span style="color: #0000BB">type</span><span style="color: #007700">()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #DD0000">'Apple'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /></span><span style="color: #0000BB">ReflectionClass</span><span style="color: #007700">::</span><span style="color: #0000BB">export</span><span style="color: #007700">(</span><span style="color: #DD0000">'Apple'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>The above example will output
something similar to:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Class [ &lt;user&gt; class Apple ] {
  @@ php shell code 1-8

  - Constants [0] {
  }

  - Static properties [0] {
  }

  - Static methods [0] {
  }

  - Properties [2] {
    Property [ &lt;default&gt; public $var1 ]
    Property [ &lt;default&gt; public $var2 ]
  }

  - Methods [1] {
    Method [ &lt;user&gt; public method type ] {
      @@ php shell code 5 - 7
    }
  }
}
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-reflectionclass.export-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="methodname"><a href="reflectionclass.getname.php" class="methodname" rel="rdfs-seeAlso">ReflectionClass::getName()</a> - Gets class name</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites