Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72441 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57945 invoked from network); 10 Feb 2014 15:29:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Feb 2014 15:29:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.54 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.54 mail-oa0-f54.google.com Received: from [209.85.219.54] ([209.85.219.54:52702] helo=mail-oa0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/10-57220-840F8F25 for ; Mon, 10 Feb 2014 10:29:12 -0500 Received: by mail-oa0-f54.google.com with SMTP id i4so7664293oah.13 for ; Mon, 10 Feb 2014 07:29:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=grKvvuCn3CUxo60SUP+UlWuvvSyJkf8TG+2KenCHLsA=; b=EDSX1vv4gu8VADt1mQ/ZtEK3xqeiJj654VdgrQ5HQxyFvewDBJ1ze074CDQbxnHnwl 8anqPkrGtMCinDlIXUZJTi1Y1YPzD6DLRf8vA8JaUq6MT8IRwFzfdGqaI6zxOPa0EHXI suKvnVKP5yrpEvWugwT9PHCeW0nCwbg+sXuvW7A8ndH0/izTFVxn0kdlZ6yJojg1z+Is ZDgQdjH2kW8H8H/wnjo/qoBkVTs501mqe3oUm2wTScI36/IO+cVb93GryXesxFwh6qwT FBjPkT0LduSrGzu9pvf8V+st6FO7DszWsCJOJlYVKA7LNnSisMVCZWkd+3gcXXpLitsN 69ew== MIME-Version: 1.0 X-Received: by 10.182.33.6 with SMTP id n6mr2271853obi.48.1392046149416; Mon, 10 Feb 2014 07:29:09 -0800 (PST) Received: by 10.182.54.112 with HTTP; Mon, 10 Feb 2014 07:29:09 -0800 (PST) In-Reply-To: References: Date: Mon, 10 Feb 2014 16:29:09 +0100 Message-ID: To: Julien Pauli Cc: PHP Internals Content-Type: multipart/alternative; boundary=089e0158a8363f3b2804f20f00f5 Subject: Re: [PHP-DEV] token_get_all() new API From: nikita.ppv@gmail.com (Nikita Popov) --089e0158a8363f3b2804f20f00f5 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Feb 10, 2014 at 3:54 PM, Julien Pauli wrote: > Hi all, > > I recently worked on token_get_all() implementation to add an extra > argument to the function to show token names directly in the output > instead of having to call token_name() on every output (usually what > is done nowadays). > > I also added a flag so that the parsed scanner value can become > optionnal in the output, as sometimes one just wants a token stream > and is not interested in dealing with the scanner ouput. > > If you have ideas or thoughts ? > > https://github.com/jpauli/php-src/compare/token_names > > Julien.P > Do you have some examples for practical uses of these modes? E.g. in what situation would you need only the token names, but not their content? What I don't like about this change is that it introduces an additional llist indirection, which presumably will have the function slower and more memory heavy. Nikita --089e0158a8363f3b2804f20f00f5--