Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109889 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94339 invoked from network); 28 Apr 2020 17:58:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Apr 2020 17:58:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A0D9F1804C2 for ; Tue, 28 Apr 2020 09:31:56 -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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, 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-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (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, 28 Apr 2020 09:31:55 -0700 (PDT) Received: by mail-io1-f53.google.com with SMTP id 19so23586122ioz.10 for ; Tue, 28 Apr 2020 09:31:55 -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=1zjOpKsaykPKq7MgswdF25myWq26uWOFDIcPbbnbZlU=; b=d2mR1NFUreadII//wXk+zXupM6j47kN7uRczBLhwxmvzDtRV/SletcJy0lv2qM2str msZOP/9VNBShxrNJZFIpbpuqySx3DcV7Pyt6iagIazqy6zTQ5tIv09JBcnhqF0M2ePnb +9Zt9eC/6tSpoIbjbAcrEq+fA8x5bWTfCbjZgQXZK3ZDlMalTBh8fmuZNL3I37O9Hdm7 lF7ermfWy39hz3NI7c2DVdVL/0JFa4vUoPW7bEcKA1d2c49QcehFbnItWKzbcTIVLbpa JF/j6RQCnnpVcbY1NIPkoxvWrFsplaNgC0abrcEZHwDmfjwaY+vd/DXWuGHwn9C9b5L0 rV7A== 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=1zjOpKsaykPKq7MgswdF25myWq26uWOFDIcPbbnbZlU=; b=uflz855h+H32A3V2qrpjj4euByKF1yVfNsL5tWwJfmSODvgB/BDpckXSR7xGsp1tmZ CL6CRo0al0vhgTpPaaObLzSmfja3RfTrie+qUjK51gHlGt7GYowg3uKu4G0KQOBQEJRh xFfUoC7daLcbfoXBI7UeErUf8pTkRCfSYHAYgAsVBJzBzDW7dDQAESg+tAfaEWSTQ8xU jMa9ThdBi4jv17quA/uqReaIZYd+f14WosOdixU6+0SiAdCwEUj14Rx9BHBjRXs2ugW1 DnFo2yWlPbX96J2hNNeK91rC+kndvRCOduAcjaOI04wbXXrhSSqgmNIhnG0dR1w97doA KxLg== X-Gm-Message-State: AGi0Pua3QGDs5X95Tjdt7JxOGj/N5vOAJxo2yJvxrJatvBXDyumqPzr9 usuvSMQTOjieKJHoBJ58h90M/vw+RSBQ0YoEZsNaOFHA X-Google-Smtp-Source: APiQypIUJQm//vp4owbNK6tkiNJFwJ53/wPyo51UuDLuLuL5JxBn2huxM/pj9A6ZRSz22aHIHIVX2F2TvzVSU4KIwMM= X-Received: by 2002:a5e:c64d:: with SMTP id s13mr27040573ioo.44.1588091513951; Tue, 28 Apr 2020 09:31:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 28 Apr 2020 18:31:42 +0200 Message-ID: To: Guilliam Xavier Cc: PHP Internals Content-Type: multipart/alternative; boundary="0000000000008f5aca05a45c5ef2" Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Ensure correct magic methods' signatures when typed From: carusogabriel34@gmail.com (Gabriel Caruso) --0000000000008f5aca05a45c5ef2 Content-Type: text/plain; charset="UTF-8" On Thu, 16 Apr 2020 at 16:22, Guilliam Xavier wrote: > On Sun, Apr 5, 2020 at 4:02 PM Gabriel Caruso > wrote: > > > > Hello, internals. > > > > Hereby you can find the RFC Document that I want to discuss as suggested > > via https://externals.io/message/109416 and > > https://externals.io/message/107990: > > > > https://wiki.php.net/rfc/magic-methods-signature > > > > Best regards, > > > > -- Gabriel Caruso > > Hello, > > Thank you, this seems a sensible thing to add. > > Just an interrogation: the following magic methods (from the > documentation) aren't mentioned at all in the RFC: > - `__sleep(): array` > - `__wakeup(): void` > - `__unserialize(array $data): void` > - (`__invoke` is basically untyped) > - `__set_state(array $properties): object` > - `__debugInfo(): array` > Is there a reason for leaving them out? > Related, the RFC mentions that `__serialize` and `__toString` already > have a *runtime* check that they respectively return an `array` and a > `string` (when called), but why not check their signature (if typed) > at *compile time* too (i.e. make https://3v4l.org/ZPrVi an error)? > > Regards, > > -- > Guilliam Xavier > The RFC has been updated with the missing methods. If there are no further requests or comments, I'll open this RFC for voting next Friday. --0000000000008f5aca05a45c5ef2--