2013/4/10 Frank Liepert <frank.liep...@gmx.de> > Hello internals, > > again an update on the RFC, see https://wiki.php.net/rfc/instance_counter: > > - added support for object as argument > - added support for array argument (indexed array with class names) > - added more code examples > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >
It is not entirely clear how the function treats subclasses. Does it count only the *direct* instances of a class, or does it also count the instances of subclasses? class A {} class B extends A {} echo get_objects_count('A'); // 0 $a = new B; echo $a instanceof A; // 1 (true) echo get_objects_count('A'); // ??? - 0 or 1 ? Lazare Inepologlou Ingénieur Logiciel