Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109625 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 1470 invoked from network); 14 Apr 2020 14:54:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Apr 2020 14:54:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E668E180504 for ; Tue, 14 Apr 2020 06:24:36 -0700 (PDT) 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-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (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, 14 Apr 2020 06:24:36 -0700 (PDT) Received: by mail-ot1-f42.google.com with SMTP id 103so12750087otv.0 for ; Tue, 14 Apr 2020 06:24:36 -0700 (PDT) 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=6V6NhaN8zWXRLRFAF/brEKTZhfMfUCpyaYB+3E8Pa1M=; b=mE6KuymtWqCe2Ji6wg3biAMHdgUdJAS3lBaMIJs2yslWFlie5mDwPCzcj5GkwdZ76M s/kUJbBDqisc7YBmOsN7fjGt0953vJTa8pd6PvJozkyfZ9JYBv48O+/YXBblO2MdVnXh p0Q3kz4F7SRVOBfbZ+t0pQp1l+LXavo11wJFDBnGQoOtNK1ECh4Z+rNYbRwI8BAEbM9J AqVgI/btPoN8qkEejH2k1vPH/8JY6ELDfyFx2VKILSuFggDTRAextU9vhgfbrabq9PJi KGFFpf6YiACy87dU51jME2v6/CTcVembABr1e0M/7NhUBaCfD1wRx19dNb6+tT7mEFlz LuyQ== 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=6V6NhaN8zWXRLRFAF/brEKTZhfMfUCpyaYB+3E8Pa1M=; b=gTDHAA1hnJQZdfMQH2beKpOA7ygXkYpktF5BYUiuRY6BUYYXXCehLKeyiml/1xrRP3 yVrdzjVOvGyjaN2eBgXqlFduOhqRFGllx/8t9lzViwh5bzB0xXxFDSfzZXCdRTBQBvmy lReK4g0IDm6tfcGf6rrorlISMtmotsE55WjWzPqtUB5Y30yxSMJd8fEEoPw+hmvVm+2o tTwbvq0Ip4mcVacDTp/UgM+sX6kk/GPvtZF4pB1PyUEE8uV9p1V2WUhBxdvqRf0HxCcu QkQEE0pm9E2ZI4oixZCwMeIEseFfGmq+rvGauEHS2D1YsuD0Hs26fcVEQprJOBKtjES3 mUcA== X-Gm-Message-State: AGi0PubXFyhBv/V9KxgkkTumyisbAF3FCMDO3F2Qs1f/51tUgw1vf/G7 PI7EGMw0wYBYSNPGi9bFrvznssHXWh0MVjvUpFI= X-Google-Smtp-Source: APiQypINuC9sFLRs2wzKi9LrFXgau8ezHTn6Dk2lq6Rz5L3z/mRt8CIILZiGr9rxVzPHyj9RpFsyAfCkwflyv4v43JU= X-Received: by 2002:a9d:19ca:: with SMTP id k68mr18964379otk.232.1586870674251; Tue, 14 Apr 2020 06:24:34 -0700 (PDT) MIME-Version: 1.0 References: <90F4B395-F010-4196-9C40-7896D4F3F2F4@gmail.com> In-Reply-To: Date: Tue, 14 Apr 2020 15:24:21 +0200 Message-ID: To: Gabriel Caruso Cc: Claude Pache , PHP Internals Content-Type: multipart/alternative; boundary="000000000000d7e8e605a3401ede" Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Ensure correct magic methods' signatures when typed From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --000000000000d7e8e605a3401ede Content-Type: text/plain; charset="UTF-8" Hello Gabriel, >>> https://wiki.php.net/rfc/magic-methods-signature > > RFC and implementation have been updated. > There are a few things I don't understand from the RFC, let me list from the examples. > This RFC proposes to introduce the following signatures checks when magic methods are typed: My general question is: what does this mean exactly? > /** @return mixed */ > Foo::__call(string $name, array $arguments); > /** @return mixed */ > Foo::__callStatic(string $name, array $arguments); > /** @return mixed */ > Foo::__get(string $name); Does this mean we won't be allowed to declare __call($name, $arguments);? This looks against LSP to me. > Foo::__clone(): void; > /** @param mixed $args */ > Foo::__construct($args): void; > Foo::__destruct(): void; Is void going to be mandatory now? This should be specified in the RFC I think. If it's about to allow void where it wasn't allowed, I'm personally not convinced it's a good idea to open one more code-style war on this topic. When there is only one way to declare something, there is no need to come to any agreement about the code style. That's a win. > Foo::__isset(string $name): bool; > Foo::__unset(string $name): void; Same comment about LSP, but also about the type: isn't it allowed to have integers as keys? How does this play with strict_type and array access? > /** @param mixed $value */ > Foo::__set(string $name, $value): void; Is the return now going to be mandatory? And the BIG question: is all this worth the BC break? Thanks, Nicolas --000000000000d7e8e605a3401ede--