Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121624 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 55632 invoked from network); 9 Nov 2023 16:08:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Nov 2023 16:08:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CA95A1804C1 for ; Thu, 9 Nov 2023 08:08:55 -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.9 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,T_SCC_BODY_TEXT_LINE 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-yb1-f175.google.com (mail-yb1-f175.google.com [209.85.219.175]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 9 Nov 2023 08:08:55 -0800 (PST) Received: by mail-yb1-f175.google.com with SMTP id 3f1490d57ef6-d852b28ec3bso1135212276.2 for ; Thu, 09 Nov 2023 08:08:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699546134; x=1700150934; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PS05HTXWLjZDRG7BRIUHf+R6ubRsY58FPU4z9l8+6Rs=; b=TqSeFYtphqzC9mrQt+F3W2UkJjI4e2Zl6Ynkh4V8uYWYGg0EyoTK64nw7eDt0eXncb gYPZw2jf9rxQpVpcS9BrwTPqOIgF9e+G60QDKmWxvnkuMp9qiZbIf7zBkiu9N4ejF0qI b8su0pDC91VQAWrtS2TkDGPtfxy/b1rfScKnd1TbsDFayv4u07SvTBiGO7uYUOoL+v92 Y1wPzGnM+rzJUz6wMGBLVJC81WyXLh+Rc6R+lbKZCC8KLsx5i3+UahYRHgbeNO7nFeUe yhG9VS3afPaciyWTHaTtt81XrHXdVnajMMPPVLOFFd55eI9ww2dfkw3HfwsCAOWamKmS PCCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699546134; x=1700150934; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PS05HTXWLjZDRG7BRIUHf+R6ubRsY58FPU4z9l8+6Rs=; b=r8MaVzLr9AjSVlzPvrz0b1I5U9Y4MxbsqGqwOvbAWEm9dMjI2J7x7+I91jaFtJc0eB CPLz9vo2CxGLKnE1sESfcbG95Iq/B+VisJ6DM3rjU0+J9IhOqeK354SPRFi2/yNx/MWc 70ZvdTlJmnWS2cw7nVfCpexJyyQWhgNjfQl8OC/vJxqxthK6yQR03JaxR3wpv8q/y8vh tdHfxukrjK9CMsL6Rtbcd08IqhDW/19hlExAbEQr7hrp5EehRevu1aSeozZbQJK9iz4N Wf+nueJ18mCYbJIVSWJ4McJXodwSw8fXe4Qoc/Dnmu2cPozKfZ4l7Jm3RZNZwzVoEVhT kaTg== X-Gm-Message-State: AOJu0YwAIeix1Nj8OmZnWDuqKYa7GoBkdJhhk/4toiaWIPiGo1nOPjMH X+r4zXd0mXAViBC6MzblJbm37FKxmIes9z4uzR0+Ict72VQ= X-Google-Smtp-Source: AGHT+IGm9pTaXAvvqHrKcDMi8QvV1y578HGDLdtA0IZRX0JtegTmgeeC3VNNYZ3YipwIe2LjFLlxeUyacgplPWd4t5A= X-Received: by 2002:a25:3588:0:b0:d99:d1b8:672f with SMTP id c130-20020a253588000000b00d99d1b8672fmr5823857yba.33.1699546134418; Thu, 09 Nov 2023 08:08:54 -0800 (PST) MIME-Version: 1.0 References: <5144806E-E21F-4AF8-B9A2-0161561A6B9E@craigfrancis.co.uk> In-Reply-To: <5144806E-E21F-4AF8-B9A2-0161561A6B9E@craigfrancis.co.uk> Date: Thu, 9 Nov 2023 17:08:42 +0100 Message-ID: To: Craig Francis Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000009f191c0609ba6b34" Subject: Re: [PHP-DEV] Re: Passing null to parameter From: tekiela246@gmail.com (Kamil Tekiela) --0000000000009f191c0609ba6b34 Content-Type: text/plain; charset="UTF-8" I don't think that would actually be wise. Automatic casting of null to other types is a handy feature and deprecating it brings no benefit to anyone. Instead, if you want, submit a proposal to reverse the direction. Make it so that null is cast to an appropriate type in params and return values. This should only apply in loose-type mode and it would make nullable types useless. Such a change could also be complicated to implement given how ambiguous it would be. But if you can outline tangible benefits and write a PR to show how it would work, I think the community would review the RFC. But as I expressed before, the current path seems to be the most logical. Despite the decision to introduce nullable types in PHP 7, which as you pointed out creates an incompatibility with all other type juggling rules, this is the cleanest and least ambiguous solution. As for the negative responses, it's probably because it's been many PHP versions since the nullable types were introduced. People accepted it and are generally satisfied with how it works. Only after the last bit was decided to be fixed in PHP 9.0, you started a discussion pointing out that on paper it's misaligned with other parts of the language. Just because null is converted to string in one context and throws an error in another is not necessarily a bad thing. So unless it's causing some serious problems for PHP developers or users, I think it's too late to change the design of the language. Regards, Kamil --0000000000009f191c0609ba6b34--