Re: [VOTE] Weak References

From: Date: Fri, 09 Sep 2011 08:14:04 +0000
Subject: Re: [VOTE] Weak References
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
> I don't understand how the code you just gave would be useful in practice?
>

Is that question for me ? If yes, which code are you talking about ?

I've implemented a WeakMap class in the weakref pecl ext, see:
>

For ref: https://github.com/colder/php-weakref/blob/master/tests/weakmap_001.phpt


I believe this better fit people's needs. Or did you have something else in
> mind?


Talking for me, that's cool !

Just one question about the interface :
Javascript interface is based on a setter/getter rather than any kind of
ArrayAccess.
Does anybody has an idea if on this case, about ArrayAccess vs setter/getter
?
For example, wouldn't people expect "foreach" to work when $wm[] access is
possible ?
Personally, I like the current syntax, it's short. I'm just wondering of any
corner case exists?

Nicolas


Thread (69 messages)

« previous php.internals (#55327) next »