Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122220 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 29761 invoked from network); 22 Jan 2024 11:21:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Jan 2024 11:21:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1705922526; bh=XxVOIJ3TGKnV6R5GJAA6+SqP932DOZMJItB2JKWajfk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ANuE+MHQ4rLuDUY8nokAw7AzPe5dAdjNIPYXVDNCofZYTDgVlAnnn/D4H+fRi392l jE5y/m2odWm3KG/3MkxD6FjQzFDVCH0uJeyCa7O0ZPgx24y7qlgbL3A0yfr+dK1ohW pVO2fM7n5zgUatP0Q1mzUi0PUvqUSbFweUEtD3bKkxXoFa1bq0wGtwGFEaPhnU4G4S 2Rxu03TRvOqWSiwIIxi1KxLCf/0P1CO3VgjAX8+2s7LAixVahF4GbC5kcaSuCixwVG s1mg0dMWCMFUXCxX1HbHJl6leStMrdSh6DZWYdlIOFfsns4srnYCDsy8ete+M+Vml1 9xpFLYbz9RT3w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 898A3180062 for ; Mon, 22 Jan 2024 03:22:05 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 22 Jan 2024 03:22:05 -0800 (PST) Received: by mail-yb1-f179.google.com with SMTP id 3f1490d57ef6-dc21d7a7042so2317118276.2 for ; Mon, 22 Jan 2024 03:21:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705922482; x=1706527282; 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=soEi6ba6IR+bHrkAuz89Ixp/qrz4CCBFVEoYaeHJKuE=; b=LK4FOxH9p3LALuOKuboSRkoIIL/hviFmABzHsMQ4ma/FAwW1lH4gclgaTPCSxocH/A aYDQ5wgIjCCnY2BJj1DoI/q6V1CSNfgFtMVj3XYwegBzCB+dnMv1FTRXpik+2CP+udGf ROikDjRP3ICVaJ9crOnPLtrykfRaiShPcc8mAaaSU0pJNckrVxjGv9dAwTFrNpcXb/Mh nYp+1cXfhDiidBmNUTgDjbeKUkTbn+t3rCbYGFzWfWxr5oUy7ECa6FZenaGnKxJEfM6d E8VWBXIudECZKzm3KzmrMEXru6ahyb0HzvI5C05HsohJonlpx7ZBCkQQnwDVdn7vFLYB Tu0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705922482; x=1706527282; 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=soEi6ba6IR+bHrkAuz89Ixp/qrz4CCBFVEoYaeHJKuE=; b=ceMdcjg8JOj1YRU1wG08FSYH3ofRt6Vc6fWkgGYFQL8rD2TkjX/kpaLmocgGJhEDhA A7EX2OMVcJhoXRbTiuoUGvl7G/ndqexZaGMHxeD6KdszQMydeJwncS5jgL1jiWU5KwvQ KcOmxyyUe/mHmJzl0df6kIOvsOfBrjCkUdERfBZm58VLGAl5Z4MFtnHn6tD5OuLGkab4 b4T38cFuzjhfZJ9DRwHYVhvKxcIwtsdydJ7vV85oFqOzGaqLirOesw91lwV3usAbO8tb 9D00ppj/dsxqwrhS7CMGjs8zlVPL8Q7Xa2LDhXKbWXrlVRbBNCJ8C9Jxc8hWIrVP7ML5 ukgg== X-Gm-Message-State: AOJu0Ywt2SWk+F+u7gc14CHcrisLgL5uSbhalfejMsFj2v2luBb+dbhg C2xM6TF+f+Gz2cfcD0bOTzBdu2XtFuMrgtxMNIMciIk5QS7v7iY7Ii/UtDdzQAM0volLfE2ap+s 1i03fANg/Ys8fOsqeWyR0PvuD+2JRJHck/W/hGg== X-Google-Smtp-Source: AGHT+IGfGwKjIA58QAz2Lfe+aTwyuz1YHH8Tcwygw+DGG9c26W3RrkOzdfTf/9qvMzZPr/iSclRgFksKMeJJWRRr3HU= X-Received: by 2002:a05:6358:6583:b0:176:544f:d822 with SMTP id x3-20020a056358658300b00176544fd822mr1210681rwh.53.1705922146421; Mon, 22 Jan 2024 03:15:46 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 22 Jan 2024 13:15:29 +0200 Message-ID: To: "Gina P. Banyard" Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000008d4e7c060f86f3b4" Subject: Re: [PHP-DEV] [RFC] Deprecate implicitly nullable parameter type From: rokas.sleinius@gmail.com (=?UTF-8?Q?Rokas_=C5=A0leinius?=) --0000000000008d4e7c060f86f3b4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 22 Jan 2024 at 11:51, Gina P. Banyard wrote: > Hello internals, > > M=C3=A1t=C3=A9 Kocsis and myself would like to propose deprecating implic= itly > nullable parameter types. > > The RFC is available on the wiki at the following address: > https://wiki.php.net/rfc/deprecate-implicitly-nullable-types > > > Best regards, > > Gina P. Banyard > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > I just encountered this language inconsistency when trying to remove nullable from a constructor-promoted property: ``` class MyClass { public function __construct( public ?string $title =3D null // removing "?" here causes "Fatal error: Cannot use null as default value" ) { $this->title =3D $title ?: resolveTitle(); } } ``` Which is fine, there's a simple workaround, it was just surprising. --0000000000008d4e7c060f86f3b4--