Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108578 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 50935 invoked from network); 14 Feb 2020 16:17:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Feb 2020 16:17:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 92BBD1804F8 for ; Fri, 14 Feb 2020 06:32:31 -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=1.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_SOFTFAIL 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-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (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 ; Fri, 14 Feb 2020 06:32:31 -0800 (PST) Received: by mail-qv1-f46.google.com with SMTP id p2so4341406qvo.10 for ; Fri, 14 Feb 2020 06:32:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ExVUGNjAAbgqtj3DZr/XVedccJI7sK9VipvwwhL54lE=; b=DmsNOZ5g3OmDj7JUNEXfE6aWyNB9MfI1Ig2tHkboxMRdsbwFgubTMYRDWuQvAaBXpL tXXNHCdDmwlhnXYa1qGk+bDoKqbhhBO85ePJboWqIuDdICgmQCktZI2I/9invG0C0aKl 7esniFl8FmfKZoP4tkVWxkzKOyBM33kBPtOaaiJIH2KrhOaDyRj8AXmIqH+fDWYyHyck gJGEmD2MkUCyq97/nKfsG9yviA+hbd4MQugGGIPH1ewTq0R19Ndw44JqvOiClONZhoRq jJWUD03q1MQglGbcY99RTouSDIIlBwNaTMnFk+CWE6ZawXh4MeTT+h6If3HVoodnV37G vbEw== X-Gm-Message-State: APjAAAU8ceksv/cpla8SftorMkjFvopyczhkjkj3sfUeG9mNFkEBR0q7 EqhzRekJhciK9/zvVf1cTWoyxkyjvoxvdwrXlrzyNoyhRdg= X-Google-Smtp-Source: APXvYqxq19TR+RXbJx+q/YQre+hm4y1vISEGkLPe6SxvDjg0UCiSNAVa9EnFe24YbfJFBzjgBOtRoru/gHSLgYatv2Y= X-Received: by 2002:ad4:4f90:: with SMTP id em16mr2367817qvb.38.1581690750464; Fri, 14 Feb 2020 06:32:30 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 14 Feb 2020 08:33:19 -0600 Message-ID: To: Marco Pivetta Cc: Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary="0000000000005386f7059e8a1340" Subject: Re: [PHP-DEV] [RFC] token_get_all() TOKEN_AS_OBJECT mode From: pollita@php.net (Sara Golemon) --0000000000005386f7059e8a1340 Content-Type: text/plain; charset="UTF-8" On Fri, Feb 14, 2020 at 7:44 AM Marco Pivetta wrote: > On Fri, Feb 14, 2020 at 2:38 PM Sara Golemon wrote: > >> Thanks for picking it up, and I agree with your response to Larry. As >> nice >> as it would be to lazy iterate, the scanner is just in NO shape to >> tolerate >> reentering userspace and potentially reinvoking the scanner before the >> first run through is done. >> > > If this is the current state, maybe it would suffice to declare the return > type as `iterable`, and return a strict (fully populated) structure in a > first implementation, later to be changed to an iterator, if applicable? > > I think that's an optimistic, but ultimately harmless approach. Arrays satisfy Iterables. Worst case we never improve on that. Best case we get iterable token generators. +1 -Sara --0000000000005386f7059e8a1340--