Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108279 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 57023 invoked from network); 28 Jan 2020 02:56:22 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Jan 2020 02:56:22 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 58B3E1804AC for ; Mon, 27 Jan 2020 17:06:39 -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,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 40.64.0.0/10 X-Spam-Virus: No X-Envelope-From: Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12olkn2100.outbound.protection.outlook.com [40.92.23.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 27 Jan 2020 17:06:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fYnYCPnPKcqEeFcYn1zS8seW0t0qfJNOlzYvKecz7zatJKxA4kr7+vXHihIHv0Hvi4pJ9NBJyV2gT4xnZSfKd9eWEJ9tj27kO1TOFVGNrxj0ntbUVP0nqd3j46GoCgYGOEBLQrS/qgby95EyRDNVbuYhNqrRbXsicX+B4XdMg7GBS14IkZh9zdmK6ssrJDvHaBKMxwu+A65hppwmt5wiXR6lJR1dTn0RQsa3V2gbsL/QKVHMrPJx6s0goJoX1JCFj2LloBJ3sxc15WmlA7EMV1qa/Y7QGNWV2P4Cmd+CejOW1oYunvLE4Fu0TSoCkNHmzTuO7TaG0ew1E2K4ob4nDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OI6ZG6sq1xeZbYSLhH8xKC39PLvGlASHKPhSNRA+OO8=; b=KdlpHoSqW0Yr4boAiRHNmw3JadEt88rQenr24CcemUhBzCYk6uGyNBoYKiQZMNxJCpMzZQMwfJPeztJ7sHkizMYi+QXy9sXBjCNaldf5QG+E5Vvnrnitpyt1OK7cwcveqEBekv2NORyMPO1PskRqMjlzYa3jJuo1pssRJQzifptVPScwyTLmpNgu9XFgD4hpPfYBkBoCEeNBi8QNSxr3gingtDeUnKdcsTmH3q1HXPEIdDvSKDEcvjaTTkzjbikj6BVs0EmdcbpEeSbMf02f4iQ0g3csQtNqTLceRRylU+ckP0Dl/715cKeenypWr2NeQ0cMbd0GwxVAdSbvYIYmcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OI6ZG6sq1xeZbYSLhH8xKC39PLvGlASHKPhSNRA+OO8=; b=nGgKKGILG3SU2jpF6UKzd9OMvJPLwFB9QebpLraRRU//mUl5lKmbiDMVi2ly8xAl8JjB1JgxdIQd3Yl3HMMSFSR3fQam6RalMwrcLnjxtgfO2B0kGI5C628cgWGdsltFGcQulSNOagyknq6MciPwESRAeLZ8WFOpFrF3A1YAJgpRHn0+JzfHDkQRoda8xVcZ5dlKNtquOGmzWhk1+h3RIuGZ00zdfRKWItMLkTY1vQrDHZSK1IqC7DNFlOYfCd+3/CMkLRuQ8PohijJS8+ISPhFvNGJT3u0HhTKaH+aacC2qWKgD/0sXfQ0nbjeq6bT8nTYI/otqumjYWqMF0O7hKA== Received: from DM6NAM12FT013.eop-nam12.prod.protection.outlook.com (10.13.178.60) by DM6NAM12HT159.eop-nam12.prod.protection.outlook.com (10.13.179.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.12; Tue, 28 Jan 2020 01:06:36 +0000 Received: from DM5PR07MB3067.namprd07.prod.outlook.com (10.13.178.56) by DM6NAM12FT013.mail.protection.outlook.com (10.13.178.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.12 via Frontend Transport; Tue, 28 Jan 2020 01:06:36 +0000 Received: from DM5PR07MB3067.namprd07.prod.outlook.com ([fe80::29e3:53bf:163e:5beb]) by DM5PR07MB3067.namprd07.prod.outlook.com ([fe80::29e3:53bf:163e:5beb%3]) with mapi id 15.20.2665.026; Tue, 28 Jan 2020 01:06:36 +0000 To: Rowan Tommins , "internals@lists.php.net" Thread-Topic: [PHP-DEV] [RFC] "use global functions/consts" statement Thread-Index: AQHV1IfBuqjWnIu9lEWrxlRKvYFij6f9dXecgADKhQCAAFMdqIAAWbgAgABUv10= Date: Tue, 28 Jan 2020 01:06:36 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:444C407863B6E128C00C5113F34F9019ABAE8E63C699CB3121C33BAD7695A22C;UpperCasedChecksum:7F8F13C5973FD707143DAC2C61B0DF30623D83592920FB6263EA4A8EF1D3881C;SizeAsReceived:8011;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [xrwEPGC2IWJCRCryWCX8cIXJkfKPbESh] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: d34d770d-3a52-45c5-8645-08d7a38e5294 x-ms-traffictypediagnostic: DM6NAM12HT159: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SPmH7AMefSQ9aBF0H6QvT8+6FMOogpOgHYaGkXs/7dFgO7TbKOWMStZjgNSHlfWC1OoA5nqdKBtcDHGoUuKifMRi456BSX4HJeOoNh8VWKzdQSXJv8Nt84a0XenpL/jZfQjkgoJ4eklfK1clHfp3MQT+PJRrhYPsNQ1iog0c+ZpUD6AuCkxBy1FrT0E4BIeH3a/uRczdGHhVWBEza84gI91TSse4gPSTGuOcbndiEGU= x-ms-exchange-antispam-messagedata: Ack3q15wvu4L2bZvuleO4ybf07TXLdilP8ZOibTs/GENR/ygS96YUlWKTLfRIou99fDPgiyCluUWIl92AEgn9czNed4+Lk++PzOMTNX2BwsI9yw/y7WnKWTitfOyzILK3QdOEYQO4hmsvWqtm3tPYg== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: d34d770d-3a52-45c5-8645-08d7a38e5294 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jan 2020 01:06:36.1283 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM12HT159 Subject: Re: [PHP-DEV] [RFC] "use global functions/consts" statement From: tysonandre775@hotmail.com (tyson andre) > Imagine this scenario:=0A= >=0A= > * PHP 8 introduces the declare with only 'global' and 'default' options= =0A= > allowed, as proposed.=0A= > * PHP 9 makes 'default' a synonym for 'global', because it's now the=0A= > default, and adds a new 'fallback' option=0A= > * I have an application that uses the fallback mode=0A= > I can either:=0A= >=0A= > * Rewrite every file in my application prior to upgrading, and add a=0A= > declare for 'global' mode to work in PHP 8, even though it will be=0A= > redundant on PHP 9=0A= > * Add a declare for 'fallback' mode, meaning my code works on PHP 9=0A= without other changes, but can no longer compile on PHP 8=0A= =0A= I'd imagine that if there were significant changes,=0A= they would go in the next major version,=0A= and PHP 8.X.0 would (or wouldn't) add the new 'fallback' option and=0A= possibly emit deprecation notices about the 'default' option or the absence= of an option.=0A= (Possibly only if the file did have any ambiguous function/const references= )=0A= So done that way, you could run the same code both on the latest release of= PHP 8.x and PHP 9.0.=0A= =0A= I don't plan to change the default name resolution behavior in PHP 9, thoug= h,=0A= and if it does change, it might even be according to a different proposal,= =0A= so adding 'fallback' as a third option before we know what type of change i= s planned=0A= seems premature.=0A= =0A= I'd imagine the migration to 8.0 and 9.0 would be similar to 5.6 to 7.0:=0A= https://www.php.net/supported-versions.php=0A= - PHP 5.6 had an extended security support timeline,=0A= to give users time to update to php 5.6, validate and migrate to 7.0.=0A= =0A= The timeline for the release prior to 8.0 would probably reflect how hard= it would be to migrate.=0A= - Many things deprecated in PHP 5.x were removed in 7.0=0A= =0A= > Explicitly selecting a default for some value is useful when any value=0A= > would actually be acceptable, and you want to delegate the choice of=0A= > value to someone else. That's how PASSWORD_DEFAULT works, for instance -= =0A= > it means "please select a sane algorithm based on the current state of=0A= > the world". I don't think that applies here - any file will have been=0A= > written with one set of rules in mind, so "use whichever namespace rules= =0A= > are currently recommended" doesn't really make sense as an option IMO.=0A= =0A= 'default' is more of a way to explicitly indicate you have made a decision = on the option=0A= for this file, and deliberately aren't using it for the file.=0A= It's just a better name than the others I could possibly come up with ('unc= hanged', 0, etc)=0A= =0A= I see `strict_types=3D0` as similar - The value `0` is currently rarely use= d compared to leaving out the setting.=0A= If php 8.x were to become stricter about type casting by default in a few w= ays,=0A= I doubt that there would be an argument for creating `strict_types=3D'php7'= ` before we knew what those changes are,=0A= if there would be changes at all, and what the tradeoffs to supporting the = php 7 semantics are.=0A= `strict_types=3D0` would be used more often if the namespace-scoped declare= () RFC was accepted.=0A= =0A= - Tyson=