Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98618 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2953 invoked from network); 24 Mar 2017 15:34:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Mar 2017 15:34:00 -0000 Authentication-Results: pb1.pair.com header.from=david.proweb@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=david.proweb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.53 as permitted sender) X-PHP-List-Original-Sender: david.proweb@gmail.com X-Host-Fingerprint: 209.85.213.53 mail-vk0-f53.google.com Received: from [209.85.213.53] ([209.85.213.53:35575] helo=mail-vk0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/66-40046-66C35D85 for ; Fri, 24 Mar 2017 10:33:58 -0500 Received: by mail-vk0-f53.google.com with SMTP id r69so7129331vke.2 for ; Fri, 24 Mar 2017 08:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Q3fPFOzlwwUxOTpdpcJGouZa/JOZIBFWMlCppGkXozY=; b=IT7vIxLHvHXzvUU8XC62W1DRF4mcDt2IIWteUhQKeCM2yNtio112/fpy7IlIUQ93mM uK3tO696PQACRdUJfKW1xBYcCcn0AU4j3yuXQO9pZRSHazWVf/aLJdqpgeqBy4Bl6utt esd/PHGRNbMbR98+zA1XmArJix8m8liXEJn661NZjmBQ+RMJwx15wSZyLtiW8MEEGCc8 MXAbIhowzWEyrWkMAky/k9gqVsq7niaE7hng3JLgK6lQ7yQBu4CtHXH41LNOohIoVLe7 ny4JSMVZjbcfEw6z37Y513H6zlUL6EOZnyfRfu/kBiF8hVMYcRfc4uyjsDGgVErxa8hS ye/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Q3fPFOzlwwUxOTpdpcJGouZa/JOZIBFWMlCppGkXozY=; b=JT0MMrdFSrY0JdMASKtxzyaANuEjBkFaxCK0N0aJBxStGYM36X+IVRiToUMmncM0xM EA1VzE0mFiZm4cBSEcbOoGMZgxqTD9Bee3C/DDrO2sW/HdHw0+Ompw0GUHj/4XPY7sDB ij+QCudN65M9CkKhooHMEqHcUH2jwIgyHvkIK+86JEwXupznyiAzZ+xFuiy5vVJpVh+f CzKdOhyQzcTpM8xNEmfMJ9VbNFSTbH4OTkfy1n3w5oZYaQwkVTKaUPx9+SEj1AcuILQ0 OeXm360T1L0ezZQJ2GmJEZR9+wziWRv3iP/tyGQvD1xl8E3HH/0nljcUV0CRLOdZHx02 hNwg== X-Gm-Message-State: AFeK/H0rv5vT8V93ahPsqAckdAkSsXwgPKaX/VUgDCJUiYPQl4CQdjdWg3soealbJUFMaUF7DuxQyQY7K40cbg== X-Received: by 10.176.85.75 with SMTP id u11mr4340222uaa.36.1490369635578; Fri, 24 Mar 2017 08:33:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.132.204 with HTTP; Fri, 24 Mar 2017 08:33:55 -0700 (PDT) Received: by 10.103.132.204 with HTTP; Fri, 24 Mar 2017 08:33:55 -0700 (PDT) In-Reply-To: <16.06.40046.20A35D85@pb1.pair.com> References: <16.06.40046.20A35D85@pb1.pair.com> Date: Fri, 24 Mar 2017 12:33:55 -0300 Message-ID: To: Andrea Faulds Cc: PHP Internals Content-Type: multipart/alternative; boundary=f403045e2966b67f2a054b7bb8ae Subject: Re: [PHP-DEV] Re: TOKEN_AS_OBJECT for token_get_all() From: david.proweb@gmail.com (David Rodrigues) --f403045e2966b67f2a054b7bb8ae Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Em 24 de mar de 2017 12:24 PM, "Andrea Faulds" escreveu: Hi Nikita, Nikita Popov wrote: I'd like to add a new TOKEN_AS_OBJECT flag to token_get_all(), which > returns an array of PhpToken objects, rather than the mix of plain string= s > and arrays we currently have. The PhpToken class is defined as: > > class PhpToken { > public $type; > public $text; > public $line; > } > Rather than adding a flag to token_get_all() to return objects, you could potentially instead make an equivalent static method on PhpToken (PhpToken::getAll() perhaps). That would avoid mixing =E2=80=9Cobject-orien= ted=E2=80=9D and =E2=80=9Cprocedural=E2=80=9D styles, though I don't know if it matters. It = seems cleaner to me. I liked your suggestion. Maybe just change to something like SplTokenizer::parse(): SplToken[] Thanks! --=20 Andrea Faulds https://ajf.me/ --=20 PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php --f403045e2966b67f2a054b7bb8ae--