Re: [PHP-DEV] [RFC] Class instances counter

2013-04-30 Thread Patrick ALLAERT
2013/4/10 Frank Liepert : > 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 Ru

AW: [PHP-DEV] [RFC] Class instances counter

2013-04-11 Thread Frank Liepert
> 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;

Re: [PHP-DEV] [RFC] Class instances counter

2013-04-10 Thread Lazare Inepologlou
2013/4/10 Frank Liepert > 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 Ru

[PHP-DEV] [RFC] Class instances counter

2013-04-10 Thread Frank Liepert
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 unsubscr

Re: [PHP-DEV] [RFC] Class instances counter

2013-04-09 Thread Joe Watkins
On 04/09/2013 11:23 AM, Laruence wrote: if a class need that, it can implement a interface like instance_counter, which will simply can implement like: class A { public static $instance_counter = 0; public function __construct() { self::$instance_counter++; } public function __de

Re: [PHP-DEV] [RFC] Class instances counter

2013-04-09 Thread Laruence
if a class need that, it can implement a interface like instance_counter, which will simply can implement like: class A { public static $instance_counter = 0; public function __construct() { self::$instance_counter++; } public function __destruct() { self::$instance_counter--; };

[PHP-DEV] [RFC] Class instances counter

2013-04-09 Thread Frank Liepert
Hello internals, I updated the RFC (https://wiki.php.net/rfc/instance_counter): - added support for a class name, so the function can be narrowed down to a specific class - added use case -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.ph

Re: [PHP-DEV] [RFC] Class instances counter

2013-04-09 Thread Joe Watkins
On 04/09/2013 01:53 AM, David Muir wrote: On 09/04/13 10:29, Joe Watkins wrote: On 04/08/2013 09:07 PM, Madara Uchiha wrote: I'm with Morrison, I see no actual use for this. It's "cool", but what would you use it for? On Mon, Apr 8, 2013 at 10:47 PM, Levi Morrison wrote: I see little value

Re: [PHP-DEV] [RFC] Class instances counter

2013-04-08 Thread David Muir
On 09/04/13 10:29, Joe Watkins wrote: On 04/08/2013 09:07 PM, Madara Uchiha wrote: I'm with Morrison, I see no actual use for this. It's "cool", but what would you use it for? On Mon, Apr 8, 2013 at 10:47 PM, Levi Morrison wrote: I see little value in having a function that tells me how man

Re: [PHP-DEV] [RFC] Class instances counter

2013-04-08 Thread Joe Watkins
On 04/08/2013 09:07 PM, Madara Uchiha wrote: I'm with Morrison, I see no actual use for this. It's "cool", but what would you use it for? On Mon, Apr 8, 2013 at 10:47 PM, Levi Morrison wrote: I see little value in having a function that tells me how many objects of any kind I have instantiate

Re: [PHP-DEV] [RFC] Class instances counter

2013-04-08 Thread Sherif Ramadan
On Mon, Apr 8, 2013 at 4:07 PM, Madara Uchiha wrote: > I'm with Morrison, I see no actual use for this. > > It's "cool", but what would you use it for? > > On Mon, Apr 8, 2013 at 10:47 PM, Levi Morrison > wrote: > > I see little value in having a function that tells me how many objects > > of an

Re: [PHP-DEV] [RFC] Class instances counter

2013-04-08 Thread Madara Uchiha
I'm with Morrison, I see no actual use for this. It's "cool", but what would you use it for? On Mon, Apr 8, 2013 at 10:47 PM, Levi Morrison wrote: > I see little value in having a function that tells me how many objects > of any kind I have instantiated. Mostly, I see it as a way to help > teach

Re: [PHP-DEV] [RFC] Class instances counter

2013-04-08 Thread Levi Morrison
I see little value in having a function that tells me how many objects of any kind I have instantiated. Mostly, I see it as a way to help teach people about assignment of objects works in PHP: $a = new MyClass(); $b = $a; var_dump(get_object_count()); And that's about the sum of how u

[PHP-DEV] [RFC] Class instances counter

2013-04-08 Thread Frank Liepert
https://wiki.php.net/rfc/instance_counter -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php