On 26/05/2016 22:24, Lester Caine wrote:
So every time I update the current tree because the client has selected
a different initial root I have to destroy perhaps 30 person objects and
rebuild the whole lot again from scratch?

In a word, yes: if you have a different set of data, use a different set of objects to hold it.

Objects are not memory slots to be re-filled, they represent a specific instance of a thing. Creating and destroying 30 objects on a modern system is the work of nanoseconds, and not something to be avoided at all costs.

Regards,

--
Rowan Collins
[IMSoP]


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to