compare class with int
<p>I am using PHP Version 5.2.5.
I want to be able to compare my own class with int.</p>

<pre><code>abstract class A {

private $value;

    public function __construct($value)
    {
         $this-&gt;value = $value;
    }

public function __toString()
{
        return $this-&gt;value;
}

}

class B extends A { }
</code></pre>

<p>but I want to be able to use my class like this:</p>

<pre><code>$inst = new B(20);
if($inst==20) {
    //...
}
</code></pre>

<p>how I can do it?</p>
