Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108386 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 15372 invoked from network); 4 Feb 2020 16:11:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Feb 2020 16:11:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AA4F21804DA for ; Tue, 4 Feb 2020 06:23:54 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 4 Feb 2020 06:23:54 -0800 (PST) Received: by mail-io1-f65.google.com with SMTP id z8so21119213ioh.0 for ; Tue, 04 Feb 2020 06:23:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YDiUqwRLsB99ckD6NMumDwdlcyBI3aTqExU6vy9igNc=; b=Lc4WdX/PPGxNdrFovZcgXlkhGpK+ZhI7rIDKyT4/MXohy0wDa2byEEcjD3uKubQX61 mZv0OhN4U41Stlbcp4Ko14zODs1Rc/IwpiCsl2ShQy7bJmmwhGCBG95AQ6vHYT7VBW4p LjVJgt+DikDAx4mkLS3vVtblBEtHWgBxmbNNp2GR3mvrPnwF72ZYcDcncg7GP20PUmho foHKC+63C8S9OvvhFNur2dUIp62OiMOqDbcJv4+2sRktmNGbAkiyhuUdFf2iVr+WQCmw ygaoLZFJwuGZMapuqejDx2xne6FouJkc9wcr/vIH7r0ovEJWiRPLFVf2N7fuOlQykjOv Fhnw== 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=YDiUqwRLsB99ckD6NMumDwdlcyBI3aTqExU6vy9igNc=; b=bCasic9GZtF3FubNKX25HFPi0b7vzHWsGtWMf0k2HAZoq3edNdhDA4wufEw2EDr2Tw tMqOirQTMcoEzrzUumlefhiT2W+tlsGZBeTZNAqbJLM2bSegfXJlUEwqB+UstGQNNXAb HWjYGbbGCNDMGNC0uQihboRJMmFvGXMkdzvj8/rtqLLhfpYDC05o3aGkxMnJq4s1BHMQ KEGLWdskWxF73Jw/xNK1vQaUnT9iOHdiVUjP09KjtMHuoYNfiAhb+rdiXq28Ah/CgFZ/ y6+Cs62quVd4EE78HvyBxNwGFxlMoBk0aTm6tflpCGoEAMksyAHghmoO0IreGxcR2qTb Lbeg== X-Gm-Message-State: APjAAAX7qgwzpn7u4ym9cSmiAdxobeNSoWv3CNi7nh1tHWd9eziBp7ZP Ys+iKKTqCa25128OIC6cuTDT4N5GG2aIjrsmW69nd5RlH8g= X-Google-Smtp-Source: APXvYqzi+BJvePnz1uBcSZ4B12Ut2gvax7huX/jMTzlQH29lIsWjCJsqYPalbWs8d9j02u0avJsJ0e7p7hwKI9X2Mkk= X-Received: by 2002:a02:c988:: with SMTP id b8mr24684822jap.122.1580826229670; Tue, 04 Feb 2020 06:23:49 -0800 (PST) MIME-Version: 1.0 References: <5077f0f4-4532-5131-0c8b-8b38017d66b5@aimeos.com> In-Reply-To: <5077f0f4-4532-5131-0c8b-8b38017d66b5@aimeos.com> Date: Tue, 4 Feb 2020 15:23:35 +0100 Message-ID: To: "Aimeos | Norbert Sendetzky" Cc: Benjamin Eberlei , Steven Wade , PHP Internals Content-Type: multipart/alternative; boundary="000000000000df08f3059dc0c9b3" Subject: Re: [PHP-DEV] [RFC - discussion] __toArray() From: ocramius@gmail.com (Marco Pivetta) --000000000000df08f3059dc0c9b3 Content-Type: text/plain; charset="UTF-8" On Tue, Feb 4, 2020, 14:50 Aimeos | Norbert Sendetzky wrote: > 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. > The operation in question, when seen by its signature, is: (array) :: object FieldTypes -> Map String FieldTypes The proposed RFC changes this to (pardon the weird union type: my type-fu is not that advanced): (array) :: (FieldTypes|IO ToArrayTypes a) => object a -> Map String a This changes the return type of a very much pure function (even makes it non-pure: fun), and is a very, very, very clear BC break. > --000000000000df08f3059dc0c9b3--