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
> 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;
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
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
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
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--; };
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
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
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
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
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
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
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
https://wiki.php.net/rfc/instance_counter
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
14 matches
Mail list logo