Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119470 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 79369 invoked from network); 6 Feb 2023 18:08:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Feb 2023 18:08:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5D224180341 for ; Mon, 6 Feb 2023 10:08:02 -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=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS2639 136.143.188.0/23 X-Spam-Virus: No X-Envelope-From: Received: from sender4-op-o14.zoho.com (sender4-op-o14.zoho.com [136.143.188.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 6 Feb 2023 10:08:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675706878; cv=none; d=zohomail.com; s=zohoarc; b=bFxiyDwhVg85dQaxvG3SDx5CTEC0XqdjqTMbsVwCfxP/e5V9OtPLe9nPJWmEaAMlZc7joBWDLzJb7XvVaFIeJroVLnetiG4WBBaMas9IFTM2gHotGXcFmrMAb2Yg9m5BPHPBGg5gQyMVi7oR+NpYEGVt0HttLbrpqX4jIBFXxHY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675706878; h=Content-Type:Date:From:MIME-Version:Message-ID:Subject:To; bh=BE+VoIKa1K0CLjLD/6nP3ZL2XN6JRRn4UJ9juoF+7A8=; b=Hj7hYxoSIGP6mT5oUM3xzkeqF66MEbFDqOqHu1rIQd65L1P+OAl62DXZqXJadoadL6hlASqRapebtCvHDqPPqdU78jewrqMFJVtORu/ypYdY+MfVC+WlvCr9LiDk3ExTGEIqBMR9bW70V4etpoXyrQjPKhcx/py6YupUhajsjB4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=wendelladriel.com; spf=pass smtp.mailfrom=me@wendelladriel.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1675706878; s=admin; d=wendelladriel.com; i=me@wendelladriel.com; h=Date:Date:From:From:To:To:Message-Id:Message-Id:Subject:Subject:MIME-Version:Content-Type:Reply-To:Cc; bh=BE+VoIKa1K0CLjLD/6nP3ZL2XN6JRRn4UJ9juoF+7A8=; b=J6RHF/oNk0W52KNKrSUhY+XCVCLscBlMY2EgUgHmvVLzVBEzLodlnTgW5tm5qKef 0HGgL96YmoWYIA2djEVqLGrEaUARl8FfEaUGujPa8R1JGR+P7lJ9Ww0ELCXMI+X0mAU GYAcwSwxc73NIZxPkSau1YNRUflemWevLWJdfGp0= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1675706878017313.45215590830674; Mon, 6 Feb 2023 10:07:58 -0800 (PST) Date: Mon, 06 Feb 2023 18:07:57 +0000 To: "internals" Message-ID: <18627e9c82d.1185ba82a2669697.6762525826203739336@wendelladriel.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8612504_1862589074.1675706877997" Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Subject: RFC Proposal - Types for Inline Variables From: me@wendelladriel.com (Wendell Adriel) ------=_Part_8612504_1862589074.1675706877997 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello everyone. My name is Wendell Adriel, I work with PHP since 2009 and these last couple= of days I was thinking that we have made HUGE progress with types on PHP s= o far. We can add types in a lot of places, but we still don't have a way to add t= ypes to inline variables. The Idea I was talking about this on Twitter with some developers and I wanted to ch= eck how's the feeling on this. I know that there's a draft RFC that mentions this in the Future Scope sect= ion:=C2=A0https://wiki.php.net/rfc/declare_vars But my idea is not to have the declaration of variables like that. I'm thin= king on a straightforward implementation that would be like: Today=C2=A0we have: $value =3D 10; $value =3D 'foo'; // OK My proposal is to be able to do something like: int $value =3D 10; $value =3D 'foo'; // TypeError This typing would be optional and under the hood all current declarations w= ould implicitly add the mixed type to the variable. So this: $value =3D 10; Would be interpreted as: mixed $value =3D 10; ----- Implementation I'm new to the PHP source code, but I'm looking into it and studying so I c= an be able to work on the implementation and not only in creating/proposing= the RFC. If someone that has more experience wants to help me it would be great. ----- I'm happy to help with anything needed for this to happen and if someone wa= nts to discuss further just ping me. Thanks in advance for the attention. --- Best Regards, Wendell Adriel. Software Engineer=C2=A0| Investor | Amateur Photographer | Musician | INFP= =E2=80=8B https://wendelladriel.com ------=_Part_8612504_1862589074.1675706877997--