Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103728 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 17229 invoked from network); 14 Jan 2019 16:43:23 -0000 Received: from unknown (HELO mail-yw1-f52.google.com) (209.85.161.52) by pb1.pair.com with SMTP; 14 Jan 2019 16:43:23 -0000 Received: by mail-yw1-f52.google.com with SMTP id t13so8549359ywe.13 for ; Mon, 14 Jan 2019 05:19:01 -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=q8l+F2lqzWKMejejrtF3hEobU0owVEueAaMgmBOuX5Q=; b=j0oAffIkbpsnq7PNBupE935HwjcaOnlzRNHrs01B0wqpES2QOXjsMDMhDoyhTCcerS ZrcQxOKvYOA1cvx/C5CA+Cn7JES2uIIrJfdC8IzH9IcbO1TK7wss+MR0DMt2YrKfRlXg P6LNwBQ4MtE8kbwTiS1UO6OajJowM3l+VR9wcHQBx8Gf+8VhbjFpYZSa1M8vgji5STov ubFqjgGbhLLPBCZ/g9vu5su9nCayHEqSMG41magMEATd9EEDEnv07lJydeJJF7joNsAB Y8BOCswyyNZBuMKvttI1QWVpYeS8oqphRVV54+jgcJZxYZ7gtRO7gO7gdSLSyByJEHO4 M63w== 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=q8l+F2lqzWKMejejrtF3hEobU0owVEueAaMgmBOuX5Q=; b=DnqpFHSyL7x91zM0lpjGcOmKE3UmZ/iZKWePjH9+98FzIYmhPbpOn43gbqyZfrQEqE WNV9EqrRuDZZu91KYrPyZ/yZMcHJAu1EXq+RiszkL+HZwAk+xWSWLSOIRI96tjjQe0+z aA6uiB0NPiqCFVH20CDhJXQL6Qhf4dxJ1IyEMa7ahrT0pgmTggn1pR9CZGPQnQkBwGUq COyVxvs7/73FXgFtTU75DuXOutzX113btC8nXWZatiUfg6Ij1fM4+TAZCuQa1Q8GX+P6 Z5CMyJYQ7hQ+Xcy0BnyEkyi0pAgeba+rj7B/PLprXas1qlgifklhQx3Y2FDkPNhBe7uK Ff+A== X-Gm-Message-State: AJcUukfLChOsK4g7Q3pEb89FWQKiF9eG5c40BCKaP6LeeO4wtQcCac7Z 3k9rpUc8850/4Ki7CNkpaS8EPzjtl+c= X-Google-Smtp-Source: ALg8bN68zqh6GL8e/GoXSfR4e/MSaJ6MVVFnpuXEl2ng531QyNtWzG/WSM5vbYHbfBlH6K0kdS7Miw== X-Received: by 2002:a81:1fd4:: with SMTP id f203mr23490625ywf.422.1547471941085; Mon, 14 Jan 2019 05:19:01 -0800 (PST) Received: from mail-yw1-f50.google.com (mail-yw1-f50.google.com. [209.85.161.50]) by smtp.gmail.com with ESMTPSA id d3sm274090ywc.103.2019.01.14.05.19.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:19:00 -0800 (PST) Received: by mail-yw1-f50.google.com with SMTP id b63so8552346ywc.11 for ; Mon, 14 Jan 2019 05:19:00 -0800 (PST) X-Received: by 2002:a81:138a:: with SMTP id 132mr23522514ywt.196.1547471940143; Mon, 14 Jan 2019 05:19:00 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 14 Jan 2019 13:18:49 +0000 X-Gmail-Original-Message-ID: Message-ID: To: Nikita Popov Cc: Internals Content-Type: multipart/alternative; boundary="0000000000004af192057f6ae314" Subject: Re: [PHP-DEV] Making stdClass iterable From: php@duncanc.co.uk (Craig Duncan) --0000000000004af192057f6ae314 Content-Type: text/plain; charset="UTF-8" On Mon, 14 Jan 2019 at 11:57, Nikita Popov wrote: > Rather than implementing Traversable, I think it would be much better to > implement IteratorAggregate and provide a proper getIterator() > implementation. Objects that only implement Traversable are a PITA to work > with and lots of code assumes that anything Traversable will either be > Iterator or IteratorAggregate. For userland code this is strictly enforced, > but internal code can avoid this. However, the current exceptions to this > are rather niche, while stdClass is somewhat commonly used. > That makes sense, if the RFC passes I'll pick up these implementation points before proceeding, thanks --0000000000004af192057f6ae314--