Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90152 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6969 invoked from network); 5 Jan 2016 21:02:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2016 21:02:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.215.47 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.215.47 mail-lf0-f47.google.com Received: from [209.85.215.47] ([209.85.215.47:35474] helo=mail-lf0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/88-12097-A4F2C865 for ; Tue, 05 Jan 2016 16:02:03 -0500 Received: by mail-lf0-f47.google.com with SMTP id c192so125455985lfe.2 for ; Tue, 05 Jan 2016 13:02:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Otw5J2A7++b2GFmHNgcVX3GUhrNtyqFKVF+HKu8HwM0=; b=rOWWDp8tERnI6oEVd3tGSvH1GkW1Dzmi7jGrlHv770s+PDkIy5X5oHYWOcc6kT8rND AA6yl/L2nM5Ry4yy2jwxvz0PjtfuBHQNzxO7OrBFDLkrlysNoA8TqM9JMtluy9UyomCY nmBxjO+zmZ622uNbydNZKKxPt6eYu0vrou7oSaP9FuubfNxIb9L/10qc+Ia7wrM52/5y ZKAWBjQAj7W4OoS/emMJrD8XDyVVNDJn1PgMBHU8eGFS6cPJ126Jw2ZU9uxkQvZKWTd9 wnrqqUpbIDjwvODqTWwCKOtakhGB/VCiDoGbS5qsQNCxJ0srvBogx4tlQ/Wh9506QJcM UZHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Otw5J2A7++b2GFmHNgcVX3GUhrNtyqFKVF+HKu8HwM0=; b=Z3nAx1p8DcpS/KOFYYR9a6JMMzSBOV02/if9FXXUp7AZT/3aF/jerdpyjYbcShMAvS 4k+8zLEREm59HVjaP5vI8ZItTo2x69bwtM7iTvTHexH5y3pqtW+874COiE2dDk6uAuz4 81yG9+HHLxpglI3rnRwIjUCvEZuTmNQZHDV2nDbaLYwPwCjDVUqCZCZt5gO7au2uBswN fOdb4uP3YAiZ9FQIIy3yDoGf3A+EjqbF9W39Tvg4Ny0mMSM9ENujd8i9EzmwfXbN2SVM 0YiXC3VvBY+46wGnd7JKuU/sgFcxpevh4XC3JiCNqA0xxATk41E66nOZ43PA1JzZ+YHq fzHg== X-Gm-Message-State: ALoCoQky7t0WlWiOxpJAjZww+FebcPr+/iYLcXZnOCU8CCxHamSAb5R0dGogdu49K62j8w83rNyqev7KKYkVqDLvi1Wo5fyFvQ== MIME-Version: 1.0 X-Received: by 10.25.65.5 with SMTP id o5mr24811173lfa.60.1452027719763; Tue, 05 Jan 2016 13:01:59 -0800 (PST) Sender: php@golemon.com Received: by 10.112.37.44 with HTTP; Tue, 5 Jan 2016 13:01:59 -0800 (PST) X-Originating-IP: [2620:10d:c090:200::6485] In-Reply-To: <77.F6.12097.81D2C865@pb1.pair.com> References: <77.F6.12097.81D2C865@pb1.pair.com> Date: Tue, 5 Jan 2016 13:01:59 -0800 X-Google-Sender-Auth: L8qKkyZk78_fwANVS0RZ-QeIf_4 Message-ID: To: Andrea Faulds Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: [RFC] Normalize token_get_all() output (with flag) From: pollita@php.net (Sara Golemon) On Tue, Jan 5, 2016 at 12:52 PM, Andrea Faulds 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