Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101699 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71932 invoked from network); 26 Jan 2018 18:50:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jan 2018 18:50:51 -0000 Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 66.111.4.27 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 66.111.4.27 out3-smtp.messagingengine.com Received: from [66.111.4.27] ([66.111.4.27:59435] helo=out3-smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/A5-35287-6887B6A5 for ; Fri, 26 Jan 2018 13:50:48 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 6A07C20DE0 for ; Fri, 26 Jan 2018 13:50:43 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Fri, 26 Jan 2018 13:50:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=oFSTzd3CipY8PhOsA8r2bFhjavVpM Bl4sll/qmVrxYM=; b=TMPc0VMFhla7oR0AcDc/Mdy2YakObn2Diokl5LVmu+Vz7 Hp1B4cFMgLGOjtxTMAc9plIsW/lHxK9GAPjUL+6vIvAZak7H7xAkselx/qt0u1E6 2JWWwFRbADYaZhp5x9S0DLpHJG3Czstm1Nz9ISYbzIbYblzjPMU+OKql5dPdBGT8 YRDzyP5kmiOKn4K0bNbprLNU29NgsArBvJQ8nv/M3HmWk76OfhN7rAgRo1efeV9Y /84OyY7tqxK85kYEcAVlbTJGpdbJovamBk0K6uPYLfpk4fQCQwCjWLGp/+nXd/d/ OyZH+65o0BpiY8mnX7fJtfK1119Dx+E3zAZofP9JQ== X-ME-Sender: Received: from vulcan.localnet (216-80-30-152.s3222.c3-0.frg-cbr1.chi-frg.il.cable.rcncustomer.com [216.80.30.152]) by mail.messagingengine.com (Postfix) with ESMTPA id 2BE427E1A2 for ; Fri, 26 Jan 2018 13:50:43 -0500 (EST) To: internals@lists.php.net Date: Fri, 26 Jan 2018 12:50:39 -0600 Message-ID: <4124259.ncp5WUS7SN@vulcan> In-Reply-To: <7207dd2d-f315-74ed-d5cb-073afe49a978@gmx.de> References: <4895296.I5cF5gV8b7@vulcan> <7207dd2d-f315-74ed-d5cb-073afe49a978@gmx.de> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2919290.Nn3YWrvGlu"; micalg="pgp-sha256"; protocol="application/pgp-signature" Subject: Re: [PHP-DEV][RFC][DISCUSSION] Collection Inspection From: larry@garfieldtech.com (Larry Garfield) --nextPart2919290.Nn3YWrvGlu Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Friday, January 26, 2018 8:43:20 AM CST Christoph M. Becker wrote: > On 26.01.2018 at 00:28, Larry Garfield wrote: > > On the read side (which you'd want for a generator or similar), the logic > > you'd want is essentially: > > > > class Ints extends ArrayObject { > > > > public function current() : int { > > > > return parent::current(); > > > > } > > > > } > > > > Which lints fine, but when I tested it just now returns strings quite > > happily without a type error, which seems wrong to me. (Why is it doing > > that, and is it a bug?) > > ArrayObject does not have a `current` method[1] (it does not implement > Iterator, but rather IteratorAggregate), so it is never called, and > therefore the `parent::current()` call doesn't error, from what I can tell. > > For what it's worth, overriding the `offsetGet` method works as expected[2]. > > [1] > [2] Well that would explain it. I had tried offsetGet() as well, but realized after reading this that I just flat out fatfingered it. Ah well. Still, the rest of my post still applies. --Larry Garfield --nextPart2919290.Nn3YWrvGlu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEcBAABCAAGBQJaa3h/AAoJEODDCsAxcWF3cvMIAOReSvDXisQV+8iyVgnD77UQ bwHhw1+Q/kBAMowfXzmQbjFhQoCJgFhDgKpGaBrXrs5cDWAhjaKdKEjCtHztne3N mHdyOoIgQZX9UhKlzJLk+iLHeAMt5S1eY5Tqp5wS7E9QCDRPDGHwjDp07djrQ9EG VhAdLBvPGwzqhGalEaSApx6Fk4CL+TjNbAN7v8i20+PoW2swrD295HRskL56m447 KDwP3MR49SSguUSzhPhZJWP2I2A58reGgcPG3J1kOX3qXITFpvBAlDXEcYxl/FPn xeAW6WuzZH53vamyBa7yCv34cLvqoF/TczP4H1+WbvNL1phvyV6v5LJ4k58UKWQ= =DNdY -----END PGP SIGNATURE----- --nextPart2919290.Nn3YWrvGlu--