php increment a number in static constructor
<p>I need to increment a number in constructor of a class, without calling static functions. My code is as follows:</p>

<pre><code>class Addup {

static public $num;

function __construct($num) {
  echo 'My number is==&gt;' . $num;
  static::$num++;
  }
}

$inc = new Addup();//instantiated an object
echo '&lt;br&gt;';
echo $inc::$num;//should be 2, but still 1, should it be $inc = new     Addup() or $inc-&gt;addup() implemented in my class?
echo '&lt;br&gt;';
echo $inc::$num;//should be 3, but still 1
echo '&lt;br&gt;';
echo $inc::$num;//should be 4, but still 1
</code></pre>

<p>Any ideas would be welcome, Thank you</p>

<p><strong>UPD</strong> made the following refactoring:</p>

<pre><code>$inc = new Increment();//My number is==&gt;2
echo '&lt;br&gt;';
$inc = new Increment();//My number is==&gt;3
echo '&lt;br&gt;';
$inc = new Increment();//My number is==&gt;4
echo '&lt;br&gt;';
$inc = new Increment();//My number is==&gt;5
</code></pre>

<p>Is this the only way to do that without calls to functions in a class?</p>