On Tue, Jan 5, 2016 at 12:52 PM, Andrea Faulds <a...@ajf.me> wrote: > This is more of a side-note, but maybe it's worth bringing up. Since > token_get_all gives an array with subarrays of a regular structure, might it > be worthwhile returning an array of objects instead? It would probably > reduce memory usage (assuming they're objects of a Token class or something, > not StdClass), but I don't know if it's that useful. > Is the internal memory usage of (new stdClass) actually less than (array())? I know array changed a lot with PHP7, and that the kind of array we're talking about here is a mixed (which would be the least efficient), but I don't have the numbers to hand.
To your question, I'm cool either way. Though if memory/efficiency is a concern, returning an iterator would be even better, especially on large files. Though I think that's beyond the scope of this particular RFC. Maybe I should keep up my "1 RFC per day" run and suggest TOKEN_ITERATOR as yet another flag.... Maybe not. My inbox hurts. -Sara -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php