Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98549 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82953 invoked from network); 15 Mar 2017 22:33:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Mar 2017 22:33:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.175 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 209.85.220.175 mail-qk0-f175.google.com Received: from [209.85.220.175] ([209.85.220.175:35732] helo=mail-qk0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/93-38004-B31C9C85 for ; Wed, 15 Mar 2017 17:33:32 -0500 Received: by mail-qk0-f175.google.com with SMTP id v127so25645727qkb.2 for ; Wed, 15 Mar 2017 15:33:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=LBc3dozG/uMy3KmezSGg3yVNCRIzEU3KfUJVdizopQ4=; b=g1TsS+cc6uoXfvpKffKULFPn/1CWPkjArlPZfIxubU8JzoFuJsBm9X7sqcaObI1SIr EqKPq85ZIrkr+MyXoWG+WVxGT++fKr51LeZsDcclQr4P3ebpnk8hpgjhtafMqvP1Ze4O uF+GND7bXcGjTLo7n4FN6zHblC4j+7gGHKlM7Lyuix15DV8SacqQlrbKw+VHK1f97EK9 fB+oclsQv35/yW33W6PxFkpcPYAbPWHq71ckgZlZf9dTFZHOB5TLbmsWEKnpPJLAMYhG C9GR+1a0ztFUidH4rScgPtye1ImK6DBpaUc57M8FIi4d8/TzUh/xXMHNRHNgvGcS3S3x IvPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=LBc3dozG/uMy3KmezSGg3yVNCRIzEU3KfUJVdizopQ4=; b=NtUj8qJVbKvOndI1mqcXYnJM64L8McpfErcBsBF10tcBKYy8VzSoqzMcu1a91aKNbw lIsTm9z7JTJmAThHsko9VeOa1hR2abFUTU+2rT3b3RGJipu8YI8G2CZB5ssIx4UP46Se XBA+v4vOwsf/4bwzrA/2lN6eiWRfrtNCe0kiFHPpAlweAcGlxJlTaec0OHkKoQJRC0ey aU3gnS/dFFEjb/29m58w/hfAg4Ufs1p0+CmyVI1nGhp1kQfPZtFdZjjX8LtW6KzPdcPk 1qgYcdH6mL7GlkxioATxNyzckJXCSGIjLPdcv3x9t4I5CqbgdxozKuCVY0EI3lIIu9hY udOw== X-Gm-Message-State: AFeK/H07WskiNvOWoAJnntnsV3BpCy+XNCNtsdZbVmVe1YleewvcAMkdzTCbPpHgh5ZtNP+jjBIhUnuM0uS/Xw== X-Received: by 10.55.175.196 with SMTP id y187mr5728172qke.126.1489617209424; Wed, 15 Mar 2017 15:33:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.44.70 with HTTP; Wed, 15 Mar 2017 15:33:28 -0700 (PDT) Received: by 10.237.44.70 with HTTP; Wed, 15 Mar 2017 15:33:28 -0700 (PDT) In-Reply-To: References: Date: Wed, 15 Mar 2017 23:33:28 +0100 Message-ID: To: Kalle Sommer Nielsen Cc: PHP Internals List , =?UTF-8?Q?Beno=C3=AEt_Burnichon?= Content-Type: multipart/alternative; boundary=94eb2c06e9229eb8f0054acc8876 Subject: Re: [PHP-DEV] Add __toArray() method to objects that would be called on cast to array From: ocramius@gmail.com (Marco Pivetta) --94eb2c06e9229eb8f0054acc8876 Content-Type: text/plain; charset=UTF-8 It's the only way to distinguish between set and unset properties. Also the only way to get all properties from an instance of an inheritance tree. Also, it's covered by tests that were explicitly added to prevent regressions on this. Same as all similar discussions before this one: need an alternative way to do things before proposing a BC break. On 15 Mar 2017 11:27 p.m., "Kalle Sommer Nielsen" wrote: > Hi > > 2017-03-15 21:41 GMT+01:00 Marco Pivetta : > > This is a BC break due to the fact that the `(array)` cast is used to > > extract property information from private properties in library code. > > Yep, but then again that is more of an > undocumented-not-really-supported case afair, if anything then > Reflection should have the APIs to officially allow that, although I > am still skeptic of this. > > > -- > regards, > > Kalle Sommer Nielsen > kalle@php.net > --94eb2c06e9229eb8f0054acc8876--