Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104200 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 21390 invoked from network); 5 Feb 2019 20:44:33 -0000 Received: from unknown (HELO mail-lj1-f173.google.com) (209.85.208.173) by pb1.pair.com with SMTP; 5 Feb 2019 20:44:33 -0000 Received: by mail-lj1-f173.google.com with SMTP id q2-v6so3571852lji.10 for ; Tue, 05 Feb 2019 09:25:43 -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; bh=fpiBN+107HPPCY5Xu9CyxtWTA0EbqChK+Rsh4VgrGck=; b=T3NVruFk6FA9EDTyWjWgKCnauK1rwRDuwxvxNUoX6foGNIT7SfVp6sOkpAclglHj/5 i2dIXjSWGFJSZ3QK4a53LLZEfZmisHu27qqM87vYNjHMaJwnYr0CdHHIajiFxO4Y3i5r TjZW+CYETu7hoy3TkHxWn7SKgKVvR0SeCGpK3oAEetxDqDmiZSXKGHtXpI/tOMovkdOu xArNaj1bKoGVCys77W2yKqUtFOQ2YLI8/bUMChCJmvlIDG8x6tTghpE/mmeX5YAjlTA5 B05nbPft/69dEJmtHJVYggw4GTZg6sAwO3NIl2+y6Vimx8+GWwVgWeAob8z3DbBR+W0X OcMg== 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; bh=fpiBN+107HPPCY5Xu9CyxtWTA0EbqChK+Rsh4VgrGck=; b=ko1qRKv4LuVJRECovLsyHxrpfBTxw/PduX2prFKXnQWmDDj08LDKXpaI4j7is5XOwD vvpVUDhBs/+ykdANCrAVbC2OVrewe+Z90M8mU3WH8OqsDR9eACCRo4cpJieAkFfl2NcV RhIrgpsaKd3R3L/hsb/PIkyT6OzcquMmrBE1LHDbgL42CK+JY+fcDYAQ9YQVILCJv2QY udk0//FVVlZcT0bO9eGheJcl0xXhlGa/4LXwkpUGcVJbv++pJdLHpJXSk4eHAiYo8pHQ zMp541vAQE1FffNQignVDEA15FzQPDTAPk6OwIFnmjuG1G6TnKXuRCKucslvn//CQnIL 0u3A== X-Gm-Message-State: AHQUAua+MzU0DyglrxlZFjzJjEnT7mHnqz4yeQ+bBx9WjdGpE7bwF6YI uGA2SWUelpQefPz4fbyqGg5pIwERRr4= X-Google-Smtp-Source: AHgI3IbY0E+YsX3Dz5r87r9pAeMOseV0vg4zlivVTBRbHbqm3s6sLPnIffRCupMT1tYoFqie/x0miQ== X-Received: by 2002:a2e:3308:: with SMTP id d8-v6mr3608436ljc.38.1549387542866; Tue, 05 Feb 2019 09:25:42 -0800 (PST) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com. [209.85.208.182]) by smtp.gmail.com with ESMTPSA id y25sm3827435lfg.4.2019.02.05.09.25.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 09:25:42 -0800 (PST) Received: by mail-lj1-f182.google.com with SMTP id v14-v6so821591ljv.1 for ; Tue, 05 Feb 2019 09:25:41 -0800 (PST) X-Received: by 2002:a2e:9d17:: with SMTP id t23-v6mr3603676lji.57.1549387541599; Tue, 05 Feb 2019 09:25:41 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 5 Feb 2019 17:25:29 +0000 X-Gmail-Original-Message-ID: Message-ID: To: Internals Content-Type: multipart/alternative; boundary="0000000000000970b0058128e6e9" Subject: Re: [PHP-DEV] [VOTE] Making stdClass iterable From: php@duncanc.co.uk (Craig Duncan) --0000000000000970b0058128e6e9 Content-Type: text/plain; charset="UTF-8" On Tue, 5 Feb 2019 at 16:39, Levi Morrison wrote: > I just wanted to pipe in to suggest an alternative approach to > accomplish some of the same goals: an external PropertyIterator. > I believe Nikita suggested something similar, and while it would certainly be useful it doesn't accomplish the same goals as this proposal. The goal of this proposal is to make the language more consistent and less surprising. The *iterable* type accepts a plain array, but not an object that is used to represent a plain array, that's surprising to me. *stdClass* is "promoted" as part of the language, it's use is not advised against anywhere in the manual, and it's the default response format for *json_decode()* To me, this class is presented as a first class citizen, but it works like a second class one. As it looks like my first approach to resolving this inconsistency is likely to fail the vote, I'm considering a second approach now to update the docs and "officially" deprecate/discourage usage of *stdClass* --0000000000000970b0058128e6e9--