Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90585 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61342 invoked from network); 13 Jan 2016 00:54:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jan 2016 00:54:33 -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.41 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.215.41 mail-lf0-f41.google.com Received: from [209.85.215.41] ([209.85.215.41:34710] helo=mail-lf0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AF/CB-27877-840A5965 for ; Tue, 12 Jan 2016 19:54:33 -0500 Received: by mail-lf0-f41.google.com with SMTP id 17so43343056lfz.1 for ; Tue, 12 Jan 2016 16:54:32 -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=VmcDZPX2MZK2lBYPAB3K2Li17nK3jSvcL/EqTX+AaVQ=; b=Qer/c3J0Uo2s2xN+xIXPIEaAurlIuKYXk1EDpJW5DrY8FF9ZRQ3Dluob9OTsdH3vez 11fui/BicOlPq72+WA+20qadQgIAleOHGlBwlrgL8mpwouXh7PgsQKaTwy+JPFb9plLe uPywNG+L8mLPdwIvLGQxEHvyaBdsedwFhi4bm/hpot5+czlk6Y3V/5TrReK0xlo4sE1P 1yRbJLfnl7VDABMQTfhWMvLALFIzy7hLfa347R1qoxi+wU1OKmzevf39j3pzd4SuemEb 2aTOx8pbysKRBZoHMbAnGEbRGCe/007UV5FsagmjxFlNJQtbuxLeCUlDtnOHAknFftyA K/ag== 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=VmcDZPX2MZK2lBYPAB3K2Li17nK3jSvcL/EqTX+AaVQ=; b=U2dKwjIpLZa6fzUPRrOZtaQDQ8IQDFZW71D3M7aXJp6mG9YmC3HhqHggd9v0TMclVq EEG8Ge5QA6jxIRD9UgZK7KkDfO7MzAI2bB2TM8BZ64C9MXKNLXZ86dgrU8UiFsif53NC EJTzLAeFNIpuyvz/j+lvLizM7ItXLQymmdXReDVrtY8gERx5OgstrGOvcO5fRf5D/v3L AaTu4lfh73f9V5q8s3v7gQHCBDo7t4RiB6qQdRiAe1sMfhes9tcarqNfyk4Usjxt2jbs MTLRaCT4QcdcjUBJh/vqtjaUQMAxWqJl1AVYA8rGHqURB/Xe+K23CFFqqyZIXxfAQmSy PUmw== X-Gm-Message-State: ALoCoQm3fSVSYux31K4DWSrfZbhA4ZEEwXq+KVbP71rpCDbyP1cnLcD9McDg5kNsgIXFoixZ0i8klUe65lUGLAVQXMD+ORuqpw== MIME-Version: 1.0 X-Received: by 10.25.83.193 with SMTP id h184mr29655875lfb.6.1452646468502; Tue, 12 Jan 2016 16:54:28 -0800 (PST) Sender: php@golemon.com Received: by 10.112.37.44 with HTTP; Tue, 12 Jan 2016 16:54:28 -0800 (PST) X-Originating-IP: [2620:10d:c090:200::d17] In-Reply-To: <56958BA2.1040504@gmail.com> References: <77.F6.12097.81D2C865@pb1.pair.com> <56958BA2.1040504@gmail.com> Date: Tue, 12 Jan 2016 16:54:28 -0800 X-Google-Sender-Auth: NM1gxqZBvYgjyAKdi_D3vWfsJcc Message-ID: To: Stanislav Malyshev Cc: =?UTF-8?Q?Rouven_We=C3=9Fling?= , Andrea Faulds , 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 12, 2016 at 3:26 PM, Stanislav Malyshev wrote: >> How does this sound? >> 1. Keep the current RFC basically as is. It's a minor addition to >> token_get_all() which can be slotted into existing code to improve >> readability, but offers little advantage beyond that. >> 2. Make a new extension to prototype this PhpToken class outside of >> the php-src tree, add all the extra goodies we want (array of token >> return, iterator of token return, extra info, limited info, etc...) >> 3. When this extension is good and solid, propose merging into core. > > Sounds great! I wonder if it'd be possible to make a real streaming > iterator? That would be so nice. > I can't imagine why not. The scanner lends itself perfectly to the Iterator model and would end up making a much bigger dent in the memory consumption than dithering between arrays and classes (though "why not both" applies here). :) Bouncing between several tasks atm, but I'll try to get something started and invite some folks to the repo. -Sara