static_class
<?php class MyObject { public static $myStaticVar = 0; function myMethod() { self::$myStaticVar += 2; echo self::$myStaticVar."\n"; } } $instanc1 = new MyObject(); $instanc1->myMethod(); //2 $instanc2 = new MyObject(); $instanc2->myMethod(); //4