Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114946 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 76387 invoked from network); 18 Jun 2021 10:44:10 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Jun 2021 10:44:10 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3ECD2180508 for ; Fri, 18 Jun 2021 04:01:24 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (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 ; Fri, 18 Jun 2021 04:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1624014082; bh=0Yma1sHloXIW+g21iLAhDFxZsuOsp8dhDqBiGL76eXk=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=VQae/hnuxICABYNbnFt42wP5xjkyPMwWlGZPnaRvKWK0uecLKrlghz9CoIknK3rIg lQ1FH8k69lMt9oHBnO2xLGSZw03f8QPN/t/ae87tYPjkPhtY1AQvekjRCoLn0WHecU N/hxMJcqgdbP/8omhBWkd0qOUzlzDsqJO1umoY08= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.120] ([24.134.51.41]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M6lpM-1lvoop3iQw-008Izy for ; Fri, 18 Jun 2021 13:01:21 +0200 To: internals@lists.php.net References: Message-ID: Date: Fri, 18 Jun 2021 13:01:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Provags-ID: V03:K1:T7ls4w2G7hBSCL75ENLvwKs622fJOCT9/gcYVBb7YW0dJ7U8FMW MR3hwlnhNEK6ZAcylffvf6kHXA5Wxja+i9NIKLsjriAtSRG3psuFDsuhsr2MI0C9ows4SEy ONZgiq4V+Wa0Mk+x8VKFuMOZYivemUhv9OD91E2s9XVzNu/RRRRXzLvlRpihCCn0o0bDexG sddM+teH+cS9J6mCJbg+Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:0oUBlak5Wpw=:6TKT6DgsP7PaxI3RD8nCOx lffnHpOwU9X0Kd6HXcFTt+K3D5FdxH7Vo/Gk1QrTHMz25FT+6MIZX4neBgPAonyy60l907j+K sHBSX5SNkgdcHDjttK/kGRKxbvkyDaGbp8UnXktH2zfxpfzFE+AWmza2KLfiuAl7eabYevOEB RhgEW6PUogqxEU7Q4ut7SZBGfqbgW6hR8xKTzQeUhisIB4U2n/6d5n25aPi8D6p7zzL/JKs6c 7QhTNZG0CMUKd8CfkHc/IxDnqF5KNAMafBMeT4rM3XJQgUTxFsPU4BEbP97iPO4dVa3HjrFbK lpwZVp+R6/VSYXC2SPNeUKc73GG9x6ul+DvX2PLGPaFZPr+UYUlErYNlBl5ZWWOvzmQmWPpvE bCkOeOON6G+ezA3fTVOdi8dKbvs0fJO8nXaRPdlKa7QGg0fmbeHyAGCrOpTD+zE/w8uJlig4Y FRw6McsAl77u43O6uVL/0brLkaYsU/eMeQmMtvJW8eTieQY9u9YkVa4iPCruePL7/rC0HySN2 EWMdWndiwt9qeGuGQ2he0Azh0G/z7BuAsE/IBpU/Buyf5r6dL+ilXugtBd5Y5mEM/LHxa4eTq f3h/on29hl4SYvNTA+Sxa/u/Sat9fgpF4/f1HKye6i8Ho+PzWgkKREWCQf8V5+4NbmyWQBu+W JaOLrkh7MxkAGc7sB0+SxlGGijyEzc6UnHklFSzwh90Eqg4frN0S/3UTD75F9VdIi0UgJhTPB uq/5hOn/hX248/c2AkQ0dC1yDlaGUuHKsQz5+WR4EvrMr/kh/gfj/338Jg3zDyGNCXx/2U8eb gRmbUC5Cskm8w9C7tByKZUmKUy3sSt6oMzZC5Jpq8PF30VSzHfAQEz3x0BOqrpTLIDS5r+BLj q7wydU2uQ3HgbIBZHTb59JsYPDAPMI8sfWH2laQM2zJ+46bp5n4laHfLT0SvEgRR2bUF72Tuf NqrLvjYzYPxP//GygbRfX8m0T7gPxxKBBpjl92Piz8zoOB06MhT1OoshGNAIwWhJ3tDkZsLSf k923jSXK99ZUAVOnlTfRG0aOMH3LyEzReu6ru/3+sWFjk9Wk8yzTv9fe+1Cc5XfjBSEFzCJAQ mvxepf4Xjk8YAKQt699jZotdRqv3uAjQWb5 Subject: Re: [PHP-DEV] Re: [RFC] is_literal From: a.leathley@gmx.net (Andreas Leathley) On 18.06.21 08:00, Craig Francis wrote: > As there=E2=80=99s been no issues raised with supporting integers, and d= oing so > will help adoption, the implementation will be updated to allow them. > > Now to choose the name, with the options is_known() from Joe and > is_trusted() from Moritz: > > https://strawpoll.com/bd2qed2xs > > Keep in mind it might also become a dedicated type in the future. I think "trusted" is a good option, also if you think about adding it as a type in the future and how it reads for somebody looking through code. Something like public function process(string&trusted $input): string&trusted; Would be good in terms of readability and captures the meaning quite well (although having a specific trusted string type might be more sensible, to avoid these intersection types everywhere). "trusted" could be used in a similar way like the "pure" annotations in Psalm/PHPStan (just for a different meaning of course): to signify where non-trusted variables should be reported and could even be used for whole objects to signify they should only ever get and return trusted variables.