Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101723 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61082 invoked from network); 29 Jan 2018 21:26:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2018 21:26:19 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.48 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.48 mail-wm0-f48.google.com Received: from [74.125.82.48] ([74.125.82.48:55904] helo=mail-wm0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/2C-24062-8719F6A5 for ; Mon, 29 Jan 2018 16:26:18 -0500 Received: by mail-wm0-f48.google.com with SMTP id 143so17083535wma.5 for ; Mon, 29 Jan 2018 13:26:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=xSw1Il/vAmLwvXvysuzu9kOV9aQKvzAlE1gRlj6W9UI=; b=Wbg+hg1/4SjWwqgwkmxcm9wbiqoos/pxE3NJ3e+SRW0godZ/DYZ7UXDstH5fyp4AGf dcRtXpBF3LULbJrhJKcMofog+eosCEBg+k6qw9AJ9vawQFqFBeB+/Xv0Dt2OK/jFr5XW x2P7T21xJP+JfZ5s7RU+URiloyQPXRsMbfIOqcr0yp3EwNhWRxY0QxdIZAKlqPzW41Ud 4TDBL5tHhrMsaW5rbHu7hSl8a5+sr7JsI6CI4XW1pzfUTFwEwnX/CA35POLGpcNm5vaU 77onqZ6PbUO5Uw8/jVam/+Ce2qIMyvesKkbpicwOx7zSoSL7Yn7TLXQD4hgkYmyq/nOI B4Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=xSw1Il/vAmLwvXvysuzu9kOV9aQKvzAlE1gRlj6W9UI=; b=XVcdMv/x3M7Od3OXBfb80KBSDtpeWsOHbbB1U0M8TuvzQ1Bi9jDwIB8MmiTvQ0rT+T TBlmqGbArqitDoOVlxTbpy3S57gPG/DWsGSAcZXl1+Dy7HaDS4hXHdUpXt3+Grn+tZxG iv5Do7ZznRKU7XDjIcDKzmHcvDlpzwIBRLb0lzA49L9D9hFx5TT7j5HP2aXnM2lEPpS9 Kv8pftarFD6sTWjwRjeCNF4RM1iZvnm7r005oQ1ACQ2vFHkihzVGyO/iOdCOHdktydwp RBUONOQIFoGjPrqFIdgjksQcp7abjGoS/GZ73KhYhYW5KloaJJteUfOh6Cq3nBxCDdqS akyA== X-Gm-Message-State: AKwxytd+Tm6tbsxMEbuPpppB+AmfGmYLkLpGq8rjjGZs/kmbwTuKeJev kr7djvaFp5m51qqc2HQjrL19VA== X-Google-Smtp-Source: AH8x2246KD0cWmd2IQ6tsEcl4QlD0CdStpdlgeS1kwS1DC1mFuudcdiktG2qceIYIpofSXrvO877WQ== X-Received: by 10.28.192.24 with SMTP id q24mr19991713wmf.96.1517261173903; Mon, 29 Jan 2018 13:26:13 -0800 (PST) Received: from ?IPv6:2a00:23c4:4b86:4b00:24b1:e6b6:998d:d88b? ([2a00:23c4:4b86:4b00:24b1:e6b6:998d:d88b]) by smtp.gmail.com with ESMTPSA id k60sm14539905wrc.2.2018.01.29.13.26.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Jan 2018 13:26:12 -0800 (PST) Date: Mon, 29 Jan 2018 21:26:10 +0000 User-Agent: K-9 Mail for Android In-Reply-To: References: <9b12b0e2-185e-86fb-0e0b-c4f24bfbd661@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: internals@lists.php.net,Michael Morris ,PHP internals Message-ID: Subject: Re: [PHP-DEV][RFC][DISCUSSION] Collection Inspection From: rowan.collins@gmail.com (Rowan Collins) On 29 January 2018 19:14:43 GMT+00:00, Michael Morris wrote: > The is_callable() >above prevents iteration over generators, potentially consuming them >for no purpose=2E Unfortunately, it doesn't: it's not the generator definition that you'll b= e passed, but the Generator object returned when you run it, and that is no= t callable https://3v4l=2Eorg/rknQJ (The definition is more like a constructor, and I wish it didn't look so m= uch like a normal function in declaration and use=2E) Nor are generators the only non-rewindable iterables you need to worry abo= ut, so really the only options you have are to only inspect arrays, or to a= dd a big fat warning that the function may consume your iterable (or enter = an infinite loop)=2E Regards, --=20 Rowan Collins [IMSoP]