Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108374 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 90558 invoked from network); 4 Feb 2020 15:20:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Feb 2020 15:20:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E2AA618053C for ; Tue, 4 Feb 2020 05:33:09 -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_H3,RCVD_IN_MSPIKE_WL,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-yw1-f44.google.com (mail-yw1-f44.google.com [209.85.161.44]) (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 05:33:09 -0800 (PST) Received: by mail-yw1-f44.google.com with SMTP id i190so17611525ywc.2 for ; Tue, 04 Feb 2020 05:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=02hcFUw1YFa/5cwCZmpKMr15uqzpjpUXZBKj7fT/0pE=; b=FRpZmznBLMZVDRBhLQi9J7IQzAALm5IYjAB0BpRf6IvG/Y87+LffDmpcgi3uDWfDg4 tfyqQyUyuDHsRI9xSk/qWd3MgVTvGNAjk8QmwExa5tA2hlXaEY+kOz9crTImWj1tOwTU O/B+Vivl8WMS2Gm7qsTF1cTUfAb64wvglmYkCk8NUA4HPVLyzY92rM8qEy5dPdiecgpY xsoglIy1JfditkvI8CrdTmQ6RBP94NgS7YKHy2qYu+t0Zi1w1n99nTYnfA6PLtrwjRTX awJWvXZ45jbmTJHjqaBbf1g2a19trhbuV5IHecn3sllWXeQ9n6t/gKCZEBVIV9FauC0I fKMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=02hcFUw1YFa/5cwCZmpKMr15uqzpjpUXZBKj7fT/0pE=; b=AKB17z+HErDESBM/SjWtBar6FVReobPoO8f7Y8jrxsHWkdwTo8kOc3kdS69J83rpmR eDjFanszGf5GcETp7W1ydZKpEz2bjGSjZcS/7SK6CT0Lc91PSrzaqBB6m0ODftt3AgSo MasfFxIL25Rc9zwW0Ir/9X07+m/n+D512uPiozVsxvoY2z5VBm8sTtieYXAHCq3j0WKc fnCuyoVM9RBSmUyC6E1rxK4L7SZSjZ4CABYi4/yQwuLj8185yiV5UOL8bQlHjel62WYO riKe6DHSwRagHJESoIGMoVDOPRLxw9kC3zYPuI/JaTb0ymZ54EDXfxjWEbjTLZIiyfId 99Jg== X-Gm-Message-State: APjAAAXTcOSZBmlLwvWs/f1jFf3C8QBwu/2FAX1CLcXLlAhCQCkxDG+p aDbRPBPbZLDTGBD1lJO6KWU= X-Google-Smtp-Source: APXvYqzhDbuy4jAE7it5XBKO9mhab18fX81kKNdBvb5aBg11miCrGhR3tMKCkj2NGL0R/KdP+13lBQ== X-Received: by 2002:a81:a458:: with SMTP id b85mr5752087ywh.130.1580823188664; Tue, 04 Feb 2020 05:33:08 -0800 (PST) Received: from stevensbbookpro.lan (97-95-205-109.dhcp.sffl.va.charter.com. [97.95.205.109]) by smtp.gmail.com with ESMTPSA id l189sm6584063ywe.7.2020.02.04.05.33.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Feb 2020 05:33:08 -0800 (PST) Message-ID: <16758978-29D6-491C-8503-D91F147189CC@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_2F06032F-16A9-4023-8C88-E353C3A4DD34" Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\)) Date: Tue, 4 Feb 2020 08:33:07 -0500 In-Reply-To: Cc: PHP Internals To: Marco Pivetta References: X-Mailer: Apple Mail (2.3601.0.10) Subject: Re: [PHP-DEV] [RFC - discussion] __toArray() From: stevenwadejr@gmail.com (Steven Wade) --Apple-Mail=_2F06032F-16A9-4023-8C88-E353C3A4DD34 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > `__toArray` as a magic function call when `(array)` cast happen is a = bad idea: it is a BC break, Adding a new magic method is not a backwards compatibility break. The = PHP documentation on magic methods states: "Caution PHP reserves all function names starting with __ as magical. It = is recommended that you do not use function names with __ in PHP unless = you want some documented magic functionality.=E2=80=9D Any user implementing their own methods prefixed with a double = underscore is taking the chance that their code could break in the = future. > and it removes one of the very few interactions (with objects) that = didn't cause any side-effects (https://externals.io/message/98539#98545 = , = https://externals.io/message/98539#98567 = )=20 PHP 7.4 introduced the "get_mangled_object_vars()=E2=80=9D as a result = of these concerns.= --Apple-Mail=_2F06032F-16A9-4023-8C88-E353C3A4DD34--