Re: [PHP-DEV] Is reference counting necessary for a PHP implementation?

2017-09-27 Thread Sidharth Kshatriya
The incrementing of the counter is the easy part. In ref counting, while decrementing the counter for a non-scalar (objects, arrays, etc), if the counter reaches zero we need to follow all the non-scalars referenced by the non-scalar you just made zero (and decrement them too. Also, if any of them

Re: [PHP-DEV] Is reference counting necessary for a PHP implementation?

2017-09-27 Thread Stanislav Malyshev
Hi! > Is this statement correct? If I understand correctly many PHP projects > depend on the deterministic firing of `__destruct()` function to cleanup > SQL transactions or connections and so forth. Yes. But, strictly speaking, you do not have to use specifically refcounting - i.e. having some v

[PHP-DEV] Is reference counting necessary for a PHP implementation?

2017-09-27 Thread Sidharth Kshatriya
In: https://github.com/php/php-langspec/blob/master/spec/04-basic-concepts.md#reclamation-and-automatic-memory-management > Despite the use of the term refcount, conforming implementations are not required to use a reference counting-based implementation for automatic memory management. Is this