Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116519 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25705 invoked from network); 25 Nov 2021 22:19:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Nov 2021 22:19:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8C0B31804E3 for ; Thu, 25 Nov 2021 15:16:50 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 ; Thu, 25 Nov 2021 15:16:50 -0800 (PST) Received: by mail-qk1-f182.google.com with SMTP id t83so13109284qke.8 for ; Thu, 25 Nov 2021 15:16:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=grokability.com; s=google; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=hsxdMgUi6sfGjX4O4ZMitW56wlM9yC3cRdDI7QFGJzg=; b=ce7hoFLBEoRjz6uavMIz5/9ympZlaVoUi0TRqZUZzZmWhvth+Y1LctBq36Mw8a2SzO XMP12rWuHP1Mao22sKcrlJ7D7eIDlANmGoEQq2S2rQHQg/+NSXo3MvVK3aln9CQuNeXM hLDoooCXwOlN+ha+/dhy3sxOkWz8mCZ6HS/8Uxd0e/qRg0g8s4EbUJ3Eb6nqKUQ03Jdi kkjocPJN2T4xJpqOTeQZLkqmorw3b/k67bboNlodCD7uNAAB7N8mEczKv72ip1xqBztv YHcbTZjARsff5lPxIlQ0dlFbdD6FJ3sW8rVbbgihSAqYjEKVyPEyoA2ittYXyRMs+iGi xhtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=hsxdMgUi6sfGjX4O4ZMitW56wlM9yC3cRdDI7QFGJzg=; b=usIAPobkI9M9ru6wczL4C2N7zsUuM6QnOYwx9YoTcNuqbP3DLmbYmSHN03ZI5EwWyD oiQy7rFym9VWeWsk/jsB9xo8+DqAK4yyLdRN6hcRFAtUBGF1VorLsHquBxUYIPaIC9TJ s2quIN9YKijbNBbIh47HqYzsVu56IVzzYTFYmeN+TIIUsEolt54DZ1uDuQqr1TTEf7B9 r6lVbN1bf2LxOBfpG9LRFwiMuiy60tDioTixHZseRrI/m7SIG1octpeV4hlg96zxcE0I qNwz4Z8NJvklVNZ0aa8fiIiae7ybOz1E2N62Uxhxr8VYafUwa6zSkZCZmPSsRA5Ph8rK miTg== X-Gm-Message-State: AOAM532ZWNlbMGhCwhHvIcCztXBHF4IBcOlGgPD38LTLxldmTHm470rG 4a3aLyI1agEQ7sM/OzjW3a3u0STFRUgvmIkWbeJmPfYW9BGQHTDr X-Google-Smtp-Source: ABdhPJxHhAuARgzMQztrHnQvcpMxoxyK0Y38ljtNDfIQo8z77uFPi3y5iZx80dsO3dr5+D6FIPTnPTqTXjPUxAg8L44= X-Received: by 2002:a05:620a:1a9d:: with SMTP id bl29mr19414903qkb.55.1637882209353; Thu, 25 Nov 2021 15:16:49 -0800 (PST) MIME-Version: 1.0 Reply-To: Brady Wetherington Date: Thu, 25 Nov 2021 15:16:38 -0800 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [VOTE] Deprecate dynamic properties From: internals@lists.php.net ("Brady Wetherington via internals") Sorry for the 11th hour chime-in, but I wanted to add some context about this proposed change, and how it would likely affect our project and many others. I know the prospect of opt-in was already addressed, but I wanted to talk about what our experience would be here. (We make Snipe-IT, which is open-source but also a paid-for-hosting or pay-for-support project). Many modern PHP projects (like ours) have 10's or 100's of dependencies, often installed via Composer. With this change, many of those will start to throw deprecation warnings - eventually failing in PHP v9. Not every package is equally modern, or equally well-maintained. I suspect there are plenty of newer packages that will "Just Work=E2=84=A2" and that's great! But there are probably many old= er packages, or more poorly-maintained ones, that will not. Packagist has around 3 million packages. Figure half are "not modern" (needing updates to be compatible with the proposed change) - that'd be 1.5 million packages. (And that's probably pretty conservative). Figure it takes an hour, each, to fix them all (again, that's conservative). That's 1.5 million hours, which is 171 developer-years. That's effectively 2 or 3 developer lifetimes (probably more, if we try to include work-life balance and whatnot :P ) And what are 9 out of 10 maintainers going to do? They'll just plaster #[AllowDynamicProperties] in front of every class, and be done with it. Voila! Compatibility. So the bulk of those 171 developer-years will be wasted. I think opt-in would be a better approach - per-class, certainly (#[FixedProperties] or #[StaticProperties] maybe?), but maybe per-file as well, or maybe even in php.ini if we want to go per-project. Different language front-ends to the php back-end engine could certainly by default jam the attribute in on every class; that'd be fine. But for PHP itself, one of its massive selling points has been that it tries very hard not to break compatibility - I have written code for PHP v4 that I have been able to drag up to PHP v7.x without too much work. I'd hate to lose that, or make it much harder - especially for dependencies that I don't have direct control over. By no means am I suggesting that PHP is a 'dead language' - but let's not cram ourselves into a Python2/Python3 compatibility hole where we make upgrades into a nightmare for people. Adding types for variables and parameters has been optional and is gradually becoming the standard thing to do; I'm sure this would end up the same. Anyways, hoping to just add some more context for those who are voting on the proposal. Feel free to ask any questions you'd like and I'll be happy to answer as best I can.