trying to understand ReflectionClass in php
<pre><code>&lt;?php
interface NSerializable
{
// ...
}
class Object
{
// test...
}
/**
* A counter class test
*/
class Counter extends Object implements NSerializable
{
const START = 0;
private static $c = Counter::START;
/**
* Invoke counter test
*
* @access public
* @return int
*/
public function count()
{
return self::$c++;
}
}
// Create an instance of the ReflectionClass class
$class = new ReflectionClass('Counter');
// Print out basic information
printf(
"===&gt; The %s%s%s %s '%s' [extends %s]\n" .
" declared in %s\n" .
" lines %d to %d\n" .
" having the modifiers %d [%s]\n",
$class-&gt;isInternal() ? 'internal' : 'user-defined',
$class-&gt;isAbstract() ? ' abstract' : '',
$class-&gt;isFinal() ? ' final' : '',
$class-&gt;isInterface() ? 'interface' : 'class',
$class-&gt;getName(),
var_export($class-&gt;getParentClass(), 1),
$class-&gt;getFileName(),
$class-&gt;getStartLine(),
$class-&gt;getEndline(),
$class-&gt;getModifiers(),
implode(' ', Reflection::getModifierNames(
$class-&gt;getModifiers()))
);
// Print documentation comment
printf("---&gt; Documentation:\n %s\n",
var_export($class-&gt;getDocComment(), 1));
// Print which interfaces are implemented by this class
printf("---&gt; Implements:\n %s\n",
var_export($class-&gt;getInterfaces(), 1));
// Print class constants
printf("---&gt; Constants: %s\n",
var_export($class-&gt;getConstants(), 1));
// Print class properties
printf("---&gt; Properties: %s\n",
var_export($class-&gt;getProperties(), 1));
// Print class methods
printf("---&gt; Methods: %s\n",
var_export($class-&gt;getMethods(), 1));
// If this class is instantiable, create an instance
if ($class-&gt;isInstantiable())
{
$counter = $class-&gt;newInstance();
echo '---&gt; $counter is instance? ';
echo $class-&gt;isInstance($counter) ? 'yes' : 'no';
echo "\n---&gt; new Object() is instance? ";
echo $class-&gt;isInstance(new Object()) ? 'yes' : 'no';
}
?&gt;
</code></pre>

<p>Questions:</p>

<ol>
<li><p><code>var_export($class-&gt;getParentClass(), 1)</code>, output is:
===> The user-defined class 'Counter' [extends ReflectionClass::__set_state(array( 'name' => 'Object', ))]... <code>var_export($class-&gt;getParentClass())</code>, output is: ReflectionClass::__set_state(array( 'name' => 'Object', ))===> The user-defined class 'Counter' [extends ]... why?</p></li>
<li><p><code>$class-&gt;getParentClass()</code>, output is: ReflectionClass::__set_state(array( 'name' => 'Object', )) what does this mean: '__set_state'?</p></li>
<li><p><code>getModifiers()</code>,<code>getModifierNames()</code> what does these two functions actually mean? </p></li>
</ol>
