Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90581 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50139 invoked from network); 12 Jan 2016 23:26:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jan 2016 23:26:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.45 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.45 mail-pa0-f45.google.com Received: from [209.85.220.45] ([209.85.220.45:36682] helo=mail-pa0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/B9-27877-7AB85965 for ; Tue, 12 Jan 2016 18:26:31 -0500 Received: by mail-pa0-f45.google.com with SMTP id yy13so254636698pab.3 for ; Tue, 12 Jan 2016 15:26:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=GH0YG6rw7j19PPMkJ7fII+CAfL7VswMgydxT9fSsmmI=; b=NHUzC7S3F9wwbhfAPg1S+0CCU95tGUuBJl+JRrYOVAD8McpLqVC3TTGvsRCnCn/aKH SxFjuT3IVPd3AQ1zQ8V1adUFNQq6Y1IwueN4RHl+LZp0x1wL0zvu582idXtxLTslpRG/ PrwPw7NjZEPBSbKa7OwhBYyJ3Ecs95c1pIESqbWUbYQJOZk0ukxwo/DLiIOCjShPofqG AErbIEm75t7GRVN0RQFD6SVvd+Zx0TID4aVk5ST0wZlw8hHeOy5fKc9nQaT3hN1lmzmt soturgjnFwZrtJnS8QrbsH4azWv4hTrxKAeZBZ1tv6/YtpAWH/szHMI0XfwUM+tMXOlr 4qdg== X-Received: by 10.67.5.98 with SMTP id cl2mr193158675pad.157.1452641188517; Tue, 12 Jan 2016 15:26:28 -0800 (PST) Received: from stas-air.corp.wikimedia.org (tan1.corp.wikimedia.org. [198.73.209.1]) by smtp.gmail.com with ESMTPSA id ix2sm195290007pac.15.2016.01.12.15.26.27 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jan 2016 15:26:28 -0800 (PST) To: Sara Golemon , =?UTF-8?Q?Rouven_We=c3=9fling?= References: <77.F6.12097.81D2C865@pb1.pair.com> Cc: Andrea Faulds , PHP internals X-Enigmail-Draft-Status: N1110 Message-ID: <56958BA2.1040504@gmail.com> Date: Tue, 12 Jan 2016 15:26:26 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] Normalize token_get_all() output (with flag) From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Nice! I'll say one thing though: If we're going to introduce a class, > I'm tempted to leave token_get_all alone (or at least limit its > changes to what's in the current porposal), and have the PhpToken > class implement its own static method to do the same thing. This I like this idea better. It is also conceptually simpler - you just have one class to deal with. > 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. -- Stas Malyshev smalyshev@gmail.com