Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107199 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 24346 invoked from network); 18 Sep 2019 11:22:37 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 18 Sep 2019 11:22:37 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id DE8B72D19B6 for ; Wed, 18 Sep 2019 01:59:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Wed, 18 Sep 2019 01:59:54 -0700 (PDT) Received: by mail-vs1-xe43.google.com with SMTP id p13so3971451vsr.4 for ; Wed, 18 Sep 2019 01:59:54 -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=gR0DuoiKGQZhj6JM0rqvqev1pSulqkA545AMz4njiwE=; b=K56D/7HHucHFmLjrVonuY/raqvd3MxCY1ZlC9SSkyz9VLX2T02CrKOdMfiqmD8zpcD vKseoHDBJzGQ8x8vD/8jz0elypar7X2ktTZc6ycoPDzOLOLhpNT1ZnPnSuJxBGM/vw+3 TKzgR5kwg0PQlvZTW1tGeI+a43r3FtVllJJJUZ2fXmQT3GCYrOt0DUUHaspbJuHfHBFj dl5/wTaKnsUGMqPGQwDQ55xgUMtMhkcnB/sfN3sJtP7B75pq5JMBbw+d0UIRcueG6+c/ 0u+MSkpxl0FqBvKQzTyza0maSfx57YQ7Cs3mvwV3+9J/SWYbk0N1Wo9JoI0/zNUnY0OJ yLow== 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=gR0DuoiKGQZhj6JM0rqvqev1pSulqkA545AMz4njiwE=; b=h5s3Xv1ik1G3NJXWqhPEtFxjRbMaWURvaBb31qsnxrTEpm1GfIpYl1vspNmPFgiu4L HBshjUvEoFyAN03jyhfYvMn7bdTvQp3DiTv6YQdIvFsiQpOIaCSPQgekKzA8hX67KdYS KBEMdvF9X2uiMJFMvKiorlzUSR1C0WK36cTVLXnenk/CsoP7n5/WSFnzJAZKY3e0DMrD 1bezj4+gxPGKoUPk3My/B+k6zhs4TimgFvrfKi7S8Y+tQJHN4iZY2zr5nQ0z7NqXgYYw BqVqQeYLzneYI1Ihj3SaVmcHL0dqj9vFrZ4m0+f+MuDlFZHvOASTzcd/eHjjpScX8jOb GTGg== X-Gm-Message-State: APjAAAU0qPEb4CyRfPWyNCIo/MSWVCV2gVNwaxyndxrvZFaGPIe43K2j RtQrk0bY4BgxMv/l8XXDNjsjrF5dWlZJbIe45As= X-Google-Smtp-Source: APXvYqxJCEO+9aqSdkJUrPMD9RbhTAQfW4qdanxf4eroaCk4FBso9I5N/3mhOOHv4atuExJLWBEwcUJdtXfCOX3lRsw= X-Received: by 2002:a67:6805:: with SMTP id d5mr1544774vsc.221.1568797193752; Wed, 18 Sep 2019 01:59:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 18 Sep 2019 10:59:42 +0200 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000007552c20592d00f25" X-Envelope-From: Subject: Re: [PHP-DEV] Adding return types to internal methods (PHP 8) From: jmquarck@gmail.com --0000000000007552c20592d00f25 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi internals, I appologise for writing here without warning, and without being an active member of Internals. But I did not find any other public way to fairly contribute to the conversation: externals.io, though is claim ("opening #internals to the outside") is actually closed, and writing a blog post or a tweet thread looked unfair to me. About all these RFC discussions and the PHP evolution, from the outside it seems too petty. In my opinion, PHP lacks of the ambition to pursue a long-term vision. Any vision would be far better than having none. Otherwise you just write code, which is actually your job, but without meaning. What kind of language PHP would like to be? Having a purpose to accomplish would facilitate RFC priorization, and pull more implication from people. A clear mission, a narrow focus, does not necessarily mean a narrow feature set. Python is an example for this: they decided to fight against Go for its prominence, and they achieved spreading Python features to data, to asynchronous, etc. Plenty of old Python contributors recently mentioned how impossible has become for them to keep on track with all new features Python provides now. In comparison, PHP walks like the elders. PHP RFC's may stay as a draft, or under discussion, for years. In 2019 this looks is demoralizing when the whole RFC process should be invigorating for the community. My claim is for you all to leave aside these minor disagreements and discuss, internally as well as with the community, what that mission might be. PHP has strengths no other general purpose language has, why not leverage them? Actually, this is not the topic for my writing here, but I also suggest spending some time, or appointing someone, to improve this whole communication toolset: it is old-fashioned, and stops contribution. Best. Jordi Martinez Missatge de Nikita Popov del dia dg., 11 d=E2=80=99a= g. 2019 a les 10:44: > Hi internals, > > Something that came up in the arginfo thread: We can now add type > annotations for everything, apart from return types on methods of non-fin= al > classes. > > The reason is that adding these return types would require inheriting > classes to specify them as well. The same problem does not exist for > argument types thanks to > https://wiki.php.net/rfc/parameter-no-type-variance > (which is exactly why we wanted that RFC). > > For example, if we add a "string" return type to DateTimeZone::getName(), > then any userland child of DateTimeZone would also have to specify a stri= ng > return type. > > The good news: Userland classes can already specify those types *now*, > because adding a return type in a child class is legal. This means that i= f > we add those return types, userland extensions do not have to bump their > minimum requirement to PHP 8 when adding the return type: They can still = be > compatible all the way down to PHP 7 (or 7.1, depending on the type). > > What do you think about this? As we are currently annotating everything > with types, and we're at a major version, this would be the ideal time to > make this change. But there's certainly a BC break here. (And, for the > record, this is not the type of BC break where P++ or editions help, > without creating a larger mess.) > > Regards, > Nikita > --0000000000007552c20592d00f25--