Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108004 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 58973 invoked from network); 6 Jan 2020 11:24:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Jan 2020 11:24:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3B1CA18050B for ; Mon, 6 Jan 2020 01:29:29 -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.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-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (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 ; Mon, 6 Jan 2020 01:29:28 -0800 (PST) Received: by mail-io1-f47.google.com with SMTP id z8so47919037ioh.0 for ; Mon, 06 Jan 2020 01:29:28 -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=tXh5pTLKqoAGcdXkKt9bpyGKMNlqL1gJ0RiUXlTHzdg=; b=XQaJg9m+K1EUQVTyNtRt2cVfrk5FvtvRhCOuNfMR7ASwP4Kg7/C2f3l//f/1cLY+g+ /Ruij/+OmKL+RE2sJP+UBbQDy54ZOf2pxFVXEAKzD4dVYqXTwa9+G1nrnHAHPYUqZBno UVn+J/6rYP44MCIZz8OMRL56MwAZB9PtjcubZuh68v+rsEd0jqCi+Mw5dTAPT3JX/NlM q+cQPAxR/z+1rKwQ+UcQncRIks20easz+NmD8/aHoQsjJTPqfahMHfYNb5Mc4q1rCIwc P/fgS84vT0oTUp9fhJMU5CZicFS+OQuAecQJ7v+jC52lDX36L8w/6wcgQts2A2Uh+EWQ lGyQ== 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=tXh5pTLKqoAGcdXkKt9bpyGKMNlqL1gJ0RiUXlTHzdg=; b=X4MLnck58xUmNNOqgByT5brNHvMKk98ndd2ECMn7hQZTQF4uzN410DHU2RSV3g+HX1 sjX8QCfu9sXQjN2hcTkFyv8dDl4PPlq+gq+VrQGA7zJCnHGAudM08S6UkeGbhfJXMeH4 t7u61vqtyY1HTUWJYi1bfT+0mNWbtVutu3IrLuWAW17TomnTnrw5oy+0q/vqnpSIQC2f mLBTwOVBm3ALG6bhBlitoTik8anz2I07PzDb18gLvSczuSe7QmwxF0WkCcJIopL60XIC C59Flbs+yVz21hqiEdPtitKLFTCUCrrouvDsIjReyBW1u82+/Tv2e/m5hszmuOEQdbmU yHAw== X-Gm-Message-State: APjAAAWzBy2Kl3yr/WSu+luhtfBpzrcAJT9jB6iJ/exqQPxIoBpzx26q jbMnt4kGtbG1yiIuoMXIt/8yz74n7l9pVVA/WFw= X-Google-Smtp-Source: APXvYqzeZiVJUR19Vn8FJRZX+VrfF8W+Sev6XB1nxFhawFJclig27uZeUs4SeJFwJ2o8dj67B3oL5PPsA6lWXXJuXcE= X-Received: by 2002:a6b:e00b:: with SMTP id z11mr67280466iog.299.1578302968079; Mon, 06 Jan 2020 01:29:28 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 6 Jan 2020 10:29:17 +0100 Message-ID: To: "G. P. B." Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000c2aada059b754b26" Subject: Re: [PHP-DEV] Ensure correct signatures for PHP magic methods From: carusogabriel34@gmail.com (Gabriel Caruso) --000000000000c2aada059b754b26 Content-Type: text/plain; charset="UTF-8" Hello George On Mon, 6 Jan 2020 at 01:28, G. P. B. wrote: > On Sun, 5 Jan 2020 at 18:44, Gabriel Caruso > wrote: > >> Hello Internals, >> >> I have a PR proposing to start checking the signatures for PHP magic >> methods in the next major version of PHP: >> https://github.com/php/php-src/pull/4177. The idea for this PR came from >> https://bugs.php.net/bug.php?id=69718. >> >> I'd like to hear your opinion before putting more effort into this :) >> >> Best regards. >> > > Hello Gabriel, > > I do like the idea, but I would agree that I'd want void as the return > type instead of a no return compile error. > Other than that +1 from my side. > The reason why I didn't want to go with `__construct(): void`, for example, is because some articles that I've read say that Constructors and Destructors do not return anything: - https://www.geeksforgeeks.org/php-constructors-and-destructors/ - https://docs.phpdoc.org/references/phpdoc/tags/return.html - https://stackoverflow.com/questions/11904255/constructor-returning-value Also, the community has pushing this standard, as it can be seen in https://github.com/slevomat/coding-standard#slevomatcodingstandardtypehintsreturntypehint- . Best regards, > > Best regards > > George P. Banyard > --000000000000c2aada059b754b26--