 <p>This would print a JSON with all of the properties (public, private and protected) of class <code>foo</code>:</p> <pre><code>$reflection = new ReflectionClass('foo'); $properties = $reflection-&gt;getdefaultProperties(); echo json_encode($properties); </code></pre>