Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108532 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 97023 invoked from network); 13 Feb 2020 11:33:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Feb 2020 11:33:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1D848180531 for ; Thu, 13 Feb 2020 01:48:05 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 13 Feb 2020 01:48:04 -0800 (PST) Received: by mail-lj1-f171.google.com with SMTP id a13so5815459ljm.10 for ; Thu, 13 Feb 2020 01:48:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=qPzT9z0KHajhqX+irF1JYlX79RAAuw4Maoq5zQit7Wo=; b=q5M4gICnSiclMKdoYfCyi+4jN8pL0hmdBx8ExtT7aWVMdG86BGlWTZ9sRJrOBbW9Ca bLfzEdM2qAoBj6WUqQB2bmOIbyw3729b8ZeBtcl7MxSOdZx0TgLD9vb/heuOYBgzzm04 C61xDbA9bUJ2cSPZ9onYlGWDP3ct2wY+sGxqyILnflGoSHTq3K84b0GrafnXDwq0rngj rywMV3G8HhEHS+Y1lNnNDM/0R5nUaVgs00xqwSLCB2b5VeDWDNx+9SWPGyTVRhWRWhTs oTX6/niiT4FYXH+pnM+T7vvouJL2FlBO+X5dtj4kupv+V5I9+zXPfSoQiTVkMAkvBSdu A+RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=qPzT9z0KHajhqX+irF1JYlX79RAAuw4Maoq5zQit7Wo=; b=DunW649SIaFcRBsjy7BMRCRGuQyzTxEiszpKzZjSiqV7Xiy59YVUnJxZ0XsnqwbHlw 00sLhavMxvWey8L3FRGFvfOZLK1MTrxAkGDI6eGPZbcpU3ZC5bXnQl9BZDHqnhYKQEut DqXH/Dd2Y/mGWBIonvtxMRJQDuSRpy2mk8AUEFAwRs5vjpVNSYmhAYipBkWx0+bj6LD1 cbsHr+MzDDcpB6pAOXRh3wKW8UCBHwGGQy3Xa9ta/MZEciAsGXw8cipSZWUM9qKjF3xz xc9O5QKhNLvwLgT9Dj2HnvrqGga0MX54u2jGg/p1E1JLtf1oX/yNFBMLzn6hxF+K0R/o HHgg== X-Gm-Message-State: APjAAAUpUKZ5N60kXNHdNc/q7jkaoC1imw61wcrbAK0sNMTV4bS4AxAU M6BuswPQ/KTREmLc7E01zdejWe2DsGxdhE+PECTSuH+ZdLM= X-Google-Smtp-Source: APXvYqwS7fKLPQtOjtvugh4EJPeCeSeIjHmjnk/U72Q/eec+E028Emle4Xrp441hD9hwkYEhqN/CalzyhXmvHjfshMQ= X-Received: by 2002:a2e:2a84:: with SMTP id q126mr10343117ljq.258.1581587280517; Thu, 13 Feb 2020 01:48:00 -0800 (PST) MIME-Version: 1.0 Date: Thu, 13 Feb 2020 10:47:44 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000095be1059e71fc05" Subject: [RFC] token_get_all() TOKEN_AS_OBJECT mode From: nikita.ppv@gmail.com (Nikita Popov) --000000000000095be1059e71fc05 Content-Type: text/plain; charset="UTF-8" Hi internals, This has been discussed a while ago already, now as a proper proposal: https://wiki.php.net/rfc/token_as_object tl;dr is that it allows you to get token_get_all() output as an array of PhpToken objects. This reduces memory usage, improves performance, makes code more uniform and readable... What's not to like? An open question is whether (at least to start with) PhpToken should be just a data container, or whether we want to add some helper methods to it. If this generates too much bikeshed, I'll drop methods from the proposal. Regards, Nikita --000000000000095be1059e71fc05--