Re: [PHP-DEV] Re: Weak Closures

2022-01-22 Thread Christoph M. Becker
On 22.01.2022 at 17:18, Rowan Tommins wrote: > On 22/01/2022 15:30, Christoph M. Becker wrote: > >> If you trigger the garbage collector manually (i.e. call >> gc_collect_cycles() after unset($callback)), the loop terminates right >> away.  I'm not sure why it doesn't without manually triggering t

Re: [PHP-DEV] Re: Weak Closures

2022-01-22 Thread Rowan Tommins
On 22/01/2022 15:30, Christoph M. Becker wrote: If you trigger the garbage collector manually (i.e. call gc_collect_cycles() after unset($callback)), the loop terminates right away. I'm not sure why it doesn't without manually triggering the GC. Most values are freed as soon as their refcount

[PHP-DEV] Re: Weak Closures

2022-01-22 Thread Christoph M. Becker
On 21.01.2022 at 11:31, Dominic Grostate wrote: > I'd like to express my interest in a possible feature concerning weak > references. Currently closures created within a class appear to > contain a reference to the object that created it. This is of course > necessary in order for the closure to r