Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103729 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 20724 invoked from network); 14 Jan 2019 16:47:58 -0000 Received: from unknown (HELO mail-yw1-f47.google.com) (209.85.161.47) by pb1.pair.com with SMTP; 14 Jan 2019 16:47:58 -0000 Received: by mail-yw1-f47.google.com with SMTP id i73so8581894ywg.3 for ; Mon, 14 Jan 2019 05:23:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=duncanc-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UN6veyN+qSjDQ9STyRQS2zHNMY/HYl3FGA/TA8A0g5A=; b=tmQvJAIzLmf4rr47YlkV8GWa9Q4eIMO8Tp1gUHZ9O3Bl5W9wh50PGPlmc1djVIctkN Ewy0kfsNByD8WYgyLtmFroCoja5LnnHvcyYLTTk6OQR99iSIcEGXj0t1EL0gdvmlTk1E zsvEbSYRW2JythNY6H0wAVqVzMT33oBhveIgYg5XUnP1lXEH7mDSgm7jNQCn16ycQL+o 5W1TsVUEUv51X8XmOcniDbvrn5+1N4U/6zF+E+Sr0sgH0X9Tz6Q56pAgu5TabD1s25db LVy4RqUjJk9j992CSUYj7yOTP840A2skOgthz2T5TMyMxgpwt4fLrU6CsMOWL9PUGQKW a6bQ== 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=UN6veyN+qSjDQ9STyRQS2zHNMY/HYl3FGA/TA8A0g5A=; b=e49Q3TBCmRVSRuqYFTOTo+P9rOpW51P5dU+T7u7fvdOncMKo7SfsxVmGfRPYuW2RX7 o7SfjA5dO2xyK9A1JevnvIWdQGXMerXpf1+qr2RORX1X41LeL/sZ1JsJFg4vN/dq97mM cpRGDRDpUBWgsnPghAFt65N6mumYnFLSAZghruc6FqKDwkZP7PH1sPmBYfkMqLs/8/2r +U+SQZWYaxgDFmpC3+X/O4o8vfDgw0h7JCe11w0qAKyqvSeV/oCSr5bF107JqFFxKMp/ 1Aj/IKY9SkcS0EKQdchChbMV5XPa8iotCHiu8qAmZDz1KSwUfDsGocrz/37Icg6dowr5 q9Rg== X-Gm-Message-State: AJcUukemhJfeEFnvnOts1dFcxawgs0I2u7mpLWxyE6CoOgObGcBm3gwi XBBzGdQjKOJrBhwDpachJj51PL4tld4= X-Google-Smtp-Source: ALg8bN6OhouwsPltMG8i0AMft7GX98aJrLjwQA2oF5lwNmVr4IQYGEwy6BVLjTGvbPZf8zf22kicyg== X-Received: by 2002:a81:4d42:: with SMTP id a63mr23775154ywb.189.1547472216267; Mon, 14 Jan 2019 05:23:36 -0800 (PST) Received: from mail-yw1-f45.google.com (mail-yw1-f45.google.com. [209.85.161.45]) by smtp.gmail.com with ESMTPSA id u4sm219454ywu.92.2019.01.14.05.23.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:23:35 -0800 (PST) Received: by mail-yw1-f45.google.com with SMTP id d190so8559899ywd.12 for ; Mon, 14 Jan 2019 05:23:35 -0800 (PST) X-Received: by 2002:a81:4b03:: with SMTP id y3mr23639826ywa.88.1547472215619; Mon, 14 Jan 2019 05:23:35 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 14 Jan 2019 13:23:24 +0000 X-Gmail-Original-Message-ID: Message-ID: To: Dan Ackroyd Cc: Internals Content-Type: multipart/alternative; boundary="000000000000b65030057f6af3ef" Subject: Re: [PHP-DEV] Making stdClass iterable From: php@duncanc.co.uk (Craig Duncan) --000000000000b65030057f6af3ef Content-Type: text/plain; charset="UTF-8" On Sat, 12 Jan 2019 at 20:13, Dan Ackroyd wrote: > I think the correct long-term solution for this would be for us to > revisit the union type RFC (https://wiki.php.net/rfc/union_types) and > so be able to define a type like: > > type foreachable = object|iterable; > This argument makes sense to me in a pre-iterable world, but as we already have an iterable type I don't understand why it shouldn't accept stdClass as well as array. What about an array is more iterable than a stdClass object? --000000000000b65030057f6af3ef--