Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108383 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5129 invoked from network); 4 Feb 2020 15:38:04 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Feb 2020 15:38:04 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0F738180210 for ; Tue, 4 Feb 2020 05:50:15 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS34788 85.13.163.0/24 X-Spam-Virus: No X-Envelope-From: Received: from dd46610.kasserver.com (dd46610.kasserver.com [85.13.163.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 4 Feb 2020 05:50:14 -0800 (PST) Received: from [192.168.178.23] (x4d01e038.dyn.telefonica.de [77.1.224.56]) by dd46610.kasserver.com (Postfix) with ESMTPSA id 05A3E4340790; Tue, 4 Feb 2020 14:50:12 +0100 (CET) To: Marco Pivetta , Benjamin Eberlei Cc: Steven Wade , PHP Internals References: Organization: Aimeos GmbH Message-ID: <5077f0f4-4532-5131-0c8b-8b38017d66b5@aimeos.com> Date: Tue, 4 Feb 2020 14:50:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC - discussion] __toArray() From: norbert@aimeos.com (Aimeos | Norbert Sendetzky) Am 04.02.20 um 14:43 schrieb Marco Pivetta: >> I think we can't classify it as BC break, because no existing code >> implements __toArray at the moment, and hence it will not fail when this >> feature is introduced and code gets upgraded to newer versions. > > It is a BC break because it changes the semantic of `(array) $object`: the > operation is no longer stable between two versions of the language. It wouldn't be a BC breaking change if `(array) $object` works like before when __toArray() isn't implemented by an object. As nobody should have implemented __toArray() because it's a reserved name for magic methods, we should be fine.