How to get the class of a class property in php
<p>I was experimenting with php, trying to get the class of a class property. </p>

<pre><code>class A{
    public $a;
}

class B extends A{
    public $b;
}

class C extends B{
    public $c;
}

$c = new C();

echo get_class($c); // C

echo get_class($c-&gt;a);  // false
echo get_class($c-&gt;b);  // false
echo get_class($c-&gt;c);  // false
</code></pre>

<p>Using the <code>get_class</code> method I can get "C" from <em>$c</em>,<br>
 but with the properties <em>$c->a</em>, <em>$c->b</em>, <em>$c->c</em> that function returns "false".</p>

<hr>

<p><strong>Question</strong></p>

<p>How can I get the class the properties belong to? ..like:</p>

<pre><code>echo foo($c-&gt;a);  // A
echo foo($c-&gt;b);  // B
echo foo($c-&gt;c);  // C
</code></pre>

<p>is it possible?</p>