Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119185 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 81803 invoked from network); 18 Dec 2022 16:47:52 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Dec 2022 16:47:52 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5ADCB1804B4 for ; Sun, 18 Dec 2022 08:47:51 -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=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 52.96.0.0/12 X-Spam-Virus: No X-Envelope-From: Received: from CY4PR02CU007-vft-obe.outbound.protection.outlook.com (mail-westcentralusazolkn19011016.outbound.protection.outlook.com [52.103.7.16]) (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 ; Sun, 18 Dec 2022 08:47:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eo4qyaj/BLv5WF20lc+PqnNAB7Tlf2y3hAHUfu3hAyHAGz0EFFzakFiIFIYeNXLvkx5w+Vsk0jbOpL3Tz5HWzYT5na6LFnVhZVQvAowVAdWvRqVLfhsUZTX5HLAbDvdOze0w5ajPb0/YlyBU+V3iNxNcK1Yrkn9ALYykap9U4/7ldu0ohU4Zi3usYJs8HbkQr8l5B9/IKwYDhealrw4DIngtcxo525Uyi/yKIA8/DAyt0Sevi/pPpgN/4vZ7ndF4dbu+PEQ4P2gci4Wy7ORfk7zSSc33NgA+Blg0eCo9oplLnncGTjsd0n8AyYV4eiAsLXhTTzyGlMCxyxrIkjdNkg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rkJRzMJhPeuh5kHRCVSYMgnWR1wjPKfY2HE/XiZiuhE=; b=MOVkGD7KVrvEp5qILav6Qb/2FiYVMFD5kqMnKa+IZzUP9G+Hl+C5USeiATAlMIx1jQlfsetj27Gr8yGzzoNX0QKPB4yJPHEQ10EBRbSTlLANttwzuNeF6I4d9p+ez6dkPMwMF4E/PIIqOmsD0q2ES/pfqm+X5vwbuQoXZcq51wWOFLWVM12pBeDCc+HQf/qAE2lzNCHILBg68uKRnF9OK+c8iZIFn2JIfDRXfRYwiTYiUkmdacZpdm84N0lFJXgcFY8KsRoJNIHSh9Y+nCZ0NB2tJScQ3/E0ZKz2wNpGF/epA+7/X9ooIYsbcPmGJ/4iQntu9heB+ZMk3B8t+LGRaQ== 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=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rkJRzMJhPeuh5kHRCVSYMgnWR1wjPKfY2HE/XiZiuhE=; b=RUH1e6K5Dm+WfwsrfPQ0wy91r58FlcpGZGssmzzF1vwE+AKA2SoMFxY5CVvWC0mRS/0Sra51enZqBKNGQZkvEYHujdaZhHxw9TkpPQdbLdgCCBtffX4yepVCP1QM3O2l9O0rhliRvFDqZfoy5zOYUXXwI9AHOkC5tZH5iFYDuVUIWD2nsJlOqiIXEoSse/fnudNXRoAlLi8JpXiMOeMZB2fi1s4BPmZT2oPcXBd6m5JW8nhPN4ApymuYKLLWAu7me9We/DDSA2nxFsqkxD/hoOZnFa1ou6WMu5MjEulNf4UZX/TLI/jKhYENdA74jYhJPBvxOyZiBMzVFrS6JokdLQ== Received: from BN7PR05MB4033.namprd05.prod.outlook.com (2603:10b6:406:90::33) by CY4PR0501MB3828.namprd05.prod.outlook.com (2603:10b6:910:90::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Sun, 18 Dec 2022 16:47:48 +0000 Received: from BN7PR05MB4033.namprd05.prod.outlook.com ([fe80::2bff:f23b:711d:f71b]) by BN7PR05MB4033.namprd05.prod.outlook.com ([fe80::2bff:f23b:711d:f71b%6]) with mapi id 15.20.5924.016; Sun, 18 Dec 2022 16:47:47 +0000 To: Derick Rethans , PHP Developers Mailing List Thread-Topic: [PHP-DEV] [Vote] More Appropriate Date/Time Exceptions Thread-Index: AQHZEJFp+oRHu8hqdkiFUMHkVnUkuK5xAbdkgAAj+gCAAqfg9Q== Date: Sun, 18 Dec 2022 16:47:47 +0000 Message-ID: References: <0E149CE3-9124-4473-92FE-ABF11B585C77@php.net> In-Reply-To: <0E149CE3-9124-4473-92FE-ABF11B585C77@php.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [z4eBG4YAwcOFgm3O3544w+YWUv/HmZomUUC1Krw70Cw=] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN7PR05MB4033:EE_|CY4PR0501MB3828:EE_ x-ms-office365-filtering-correlation-id: 4058f0ac-34b0-44e2-4770-08dae11797ed x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CeQ+hABXaTCeek6v47Tw1RzEmR3lu8ww82gIRQ+TtjIyJbesy4rX8j/6W5HYoBL9u36KemmTKuP/4l/sh762MHLL7IwNvV0K4aVyn7/jlGCc5RQCUzkt5kn++yavx9NQQicZNz+YxofgqWeluRt6OiJa3DAr7tHWNNzL2/cj/gIbnGFoyMHn7YeApSv9iVI5WiXpULI9KZ0+YHU3meqJuKlFIvsQ7ECqG6blgspAAOeDBMB1ylaiufIm061vKvHegfW7wFq77hxgspHL6RBtqe36RZylIvksOyqyWzXnhcS7MIExUU1g+93j2DWplBdb5/E09NVn92ch+rjPp7dDQOsug2QYGLBjwmcKzqD6yr3hJtMACpKNvVMVaJ8amt/2mlo0oG2arx6m9SdL5XkOIsjjqHUIEuFU+pZBuR0p0wM8AdP4VDAMjOCv0RyxrH/mOU7XztOMXaHq8H09Wyvr5q3m+HPZYp3o4ZZF1j6IVEzc60zJZMc1BuFM9I7VKJES75G3ZKGFiywlruUOpw7OnZ/+joG4k33MhVyi94l3fIX9ITTdiEbvfduQiJE4V9+xW0kyn1J7nKjelem1NPA09mUCuoPVs/E/JyOjXmT2OdnSgeovfG5coq6PmFPq99eCKLmBSM678AOD/96Z8+qciw== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?/mBk1we97Hx5PFq15VSEzTtyY1YF01XC6IFTtkVgtcJN552KYg8bbEBbDO?= =?iso-8859-1?Q?ii//LaiOaNwV+Uh0oRlKPK27CVA/eaXkfcLC+JnTDeoC/c0dgyDraCWYJ/?= =?iso-8859-1?Q?zKtF1/MRKNiWeu4fTROAAqBZpWDIwdceeeQv7A2YXJ7hu3BiQ9aYd/SnbN?= =?iso-8859-1?Q?/pxO/5+yG0miScldWus+rZGTcd8xsetV18/9CiRWwkbPLdLawQ8fOjVEHc?= =?iso-8859-1?Q?ap9k7z/aiOP/FirctG2JA8cpBThdGw52n5fJHRZ4bFtZWCP7gx3ryZZ4oJ?= =?iso-8859-1?Q?XeSnVKyw3UoXchG6rHTcyJJo30xmaQF69xvT+feLP3ZfadEKBlvmp3DLfz?= =?iso-8859-1?Q?UXUTE217PU3SZNM0R+6E5wgrLZi7TRUMU2zreYtU3vZ/Hu1CReqPbMJ9Zw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X7NtwCKCcsBrmjT1J84E?= =?iso-8859-1?Q?frca61/1T/JemMlfcE7t9gbdmg=3D=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN7PR05MB4033.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 4058f0ac-34b0-44e2-4770-08dae11797ed X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Dec 2022 16:47:47.5441 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0501MB3828 Subject: Re: [PHP-DEV] [Vote] More Appropriate Date/Time Exceptions From: theodorejb@outlook.com (Theodore Brown) On Fri, Dec 16, 2022 at 5:09 PM Derick Rethans wrote:=0A= >On 16 December 2022 21:34:16 GMT, Theodore Brown = wrote:=0A= >>On Thu, Dec 15, 2022 at 8:27 AM Derick Rethans wrote:=0A= >>=0A= >>> Hi,=0A= >>>=0A= >>> I've just opened the vote for "More Appropriate Date/Time Exceptions".= =0A= >>> It runs until December 31st, 24:00 UTC.=0A= >>>=0A= >>> You can vote at:=0A= >>> https://wiki.php.net/rfc/datetime-exceptions#voting=0A= >>=0A= >> Hi Derick,=0A= >>=0A= >> Thank you for your work on this. I like the idea of having more specific= =0A= >> exceptions to avoid having to parse generic exception/warning strings.= =0A= >>=0A= >> However, I voted No because there doesn't seem to be an implementation= =0A= >> currently, and I'm concerned about introducing differences in error=0A= >> handling between the procedural and object-oriented date functions.=0A= >>=0A= >> Is there a rational for why the procedural date functions should continu= e=0A= >> producing generic warnings/exceptions, rather than consistently using th= e=0A= >> same exception hierarchy as the OO interface? I fear this could make it= =0A= >> harder for users to switch between the procedural and OO APIs, as some= =0A= >> errors might have to be handled in a different way.=0A= >>=0A= >> Also, could maintaining parity between the procedural/OO APIs be more=0A= >> difficult if they each implement error handling differently?=0A= >> Perhaps I'm mistaken, but I thought that currently the procedural date= =0A= >> functions are simple aliases of the corresponding object method.=0A= >=0A= > You're mistaken then. The procedural versions never threw exceptions,=0A= > and changing to that now is a big BC break, which is not warranted.=0A= >=0A= > It was always a deliberate choice (since 2014) that the procedural=0A= > versions don't throw exceptions, and the OO versions do. The RFC is not= =0A= > wanting to change this behaviour. And rightfully so.=0A= =0A= Thank you for the clarification. I know that the functions `date_create`=0A= and `date_create_immutable` have this difference in behavior from the=0A= `DateTime` and `DateTimeImmutable` constructors, and this is documented=0A= in the PHP manual.=0A= =0A= But for most other date functions there doesn't seem to be any difference.= =0A= E.g. `date_create_from_format` and `DateTime::createFromFormat` both return= =0A= false on failure.=0A= =0A= Likewise, `date_interval_create_from_date_string` and `DateInterval::create= FromDateString`=0A= both output a warning and return false on failure, as do `date_modify` and = `DateTime::modify`.=0A= See https://3v4l.org/HjXee.=0A= =0A= So I'm struggling to understand why it's okay to make a BC break for the OO= API,=0A= but not for the procedural API. As long as a BC break is being made, why no= t=0A= change `date_create` and `date_create_immutable` throw exceptions like the= =0A= constructors, rather than trying to preserve BC for only the procedural API= =0A= and ending up with even more inconsistent behavior?=0A= =0A= Best regards,=0A= Theodore=