Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121704 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 1908 invoked from network); 17 Nov 2023 10:47:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Nov 2023 10:47:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 74091180031 for ; Fri, 17 Nov 2023 02:47:31 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, MISSING_HEADERS,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-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 ; Fri, 17 Nov 2023 02:47:31 -0800 (PST) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-40836ea8cbaso13495085e9.0 for ; Fri, 17 Nov 2023 02:47:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700218049; x=1700822849; darn=lists.php.net; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:from:date:from:to:cc:subject:date :message-id:reply-to; bh=K6wYbk6zzSVVYRVYqYyuPL/hHpyFHyiiwr0inw+kqsg=; b=kcJOvOaEgUfNnkPH7bdcDN+SitZbkBNc5EbE1b40zGXO3spm7Wk9oEEtAUPW7FZhXr JRqBLBMDfAY8dVMd4u8fEnDN62TlgF8AmSF02CB/fUSZ3wxwuVotmFWnTV4zQFUgTLNu iKAnrwa6eEE78LIm/g3Y1zqsZ5e9NSq1/8m0e4QUWwnq8oP2Wen6hLo6E9R+h2AT6h8Q +6m8URttTSo+N6HA0Dp37INFuMu6ML4Yuou5S/sg0PbekwuMpRqVMFG4hlrShdVVmz0I Q3Iei6FtPlNUNWiRsrw6C94SIlW1+tyshIXvYNsI2cHQywil5C9ndOQQACnkRDA8ygaZ ZU0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700218049; x=1700822849; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:from:date:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=K6wYbk6zzSVVYRVYqYyuPL/hHpyFHyiiwr0inw+kqsg=; b=n8LH79yqz4C1T+f5JHdems3YlfxPqD3+FyI+uO5tqwaFbYAtbuM/JiSmRXeCssmSfa hVAT0j5+j93oZokGDw4Ke3TwPpsmoEXtbpfZLr8tzF87VOktr7WzKjb/rFM2RKifwVRr +rjiRglsJxs7AE980EaYbE9XwwKb3+7mSqn2ZxpSHjyphalOQVrjMXRq8GNDFAB0rrjO HExY0ovzJ8YWAhyEN3vzf/aJ0GYcrXJ11cDjn0cIuMWs2ITet4ghLZ+cIi+8gGPVZ+dO OuaFf60deKZIeDX6IolEHjfBiopxnGh/oSaWm2tmvACfu+F8rbPjBKDjAOcbWTotoiGY GIDQ== X-Gm-Message-State: AOJu0Ywv8f/fEAaih6cNmH6HW4+2bmakkx5dNpLxtpy+CAEOILHm/ktI leiYJaAmE9K4feqUgtzwCOqO13wq9yQ= X-Google-Smtp-Source: AGHT+IFrUpWzST0hZpJXukzcuqB6Nx7DQE8lgeMZvXKU/DWX1Tpar1rNzQsnPNK8T1yJIICvTyxpwQ== X-Received: by 2002:a05:6000:1881:b0:32d:9579:94e3 with SMTP id a1-20020a056000188100b0032d957994e3mr13962046wri.6.1700218048612; Fri, 17 Nov 2023 02:47:28 -0800 (PST) Received: from [127.0.0.1] (cpc83311-brig21-2-0-cust191.3-3.cable.virginm.net. [86.20.40.192]) by smtp.gmail.com with ESMTPSA id e3-20020a5d5943000000b0032db430fb9bsm1900507wri.68.2023.11.17.02.47.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Nov 2023 02:47:28 -0800 (PST) Date: Fri, 17 Nov 2023 10:47:25 +0000 CC: PHP Internals User-Agent: K-9 Mail for Android In-Reply-To: References: <2b4591c1-f999-49b5-8061-67db816aa0da@gmail.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: =?US-ASCII?Q?Re=3A_=5BPHP-DEV=5D_=5BRFC=5D=5BDiscussion=5D_Harmo?= =?US-ASCII?Q?nise_=22untyped=22_and_=22typed=22_properties?= From: rowan.collins@gmail.com (Rowan Tommins) On 16 November 2023 21:38:48 GMT, Jakub Zelenka wrote: >This sounds like a huge BC break=2E Probably bigger and a bit harder to f= ix >than disallowing dynamic props=2E More common, maybe; but trivial to fix: add "=3Dnull" at the end of all un= typed property declarations that don't already have an initializer=2E It wo= uld be trivial to automate with something like Rector=2E >Maybe it would be better to do this as some sort of opt in behaviour We already have the opt-in behaviour: add "mixed" to a property declaratio= n, and it no longer gets initialized to null=2E The aim of the RFC is to el= iminate that distinction, not to encourage typed properties=2E I do however agree that the initial value part is quite disruptive, and am= open to suggestions on how to minimise that=2E A couple that have occurred= to me: - Change the unset() behaviour, which we're already planning to make produ= ce errors in 9=2E0; but keep the implicit initializer=2E In other words, ma= ke "public $foo;" equivalent to "public mixed $foo=3Dnull;" The obvious dow= nside is that it's just as weird a special-case for users to learn as what = we have now=2E - Have a longer timeline: fix the unset() behaviour in 9=2E0, and the init= ializer in 10=2E0=2E But that just postpones both the pain and the gain=2E - Actually require all properties to have a type at some point in the futu= re, so the behaviour of untyped properties becomes a moot point=2E I'm pret= ty sure this is a non-starter since we didn't even manage to remove "var" i= n favour of "public", but I wanted to say it for completeness=2E Maybe someone can come up with some other variation or compromise? Regards, --=20 Rowan Tommins [IMSoP]