Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113341 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 26772 invoked from network); 3 Mar 2021 12:53:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Mar 2021 12:53:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3B24E1804B4 for ; Wed, 3 Mar 2021 04:44:08 -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.5 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from processus.org (ns366368.ip-94-23-14.eu [94.23.14.201]) (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 ; Wed, 3 Mar 2021 04:44:07 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by processus.org (Postfix) with ESMTPA id 4EBE25101324; Wed, 3 Mar 2021 12:44:05 +0000 (UTC) To: Hans Henrik Bergan , PHP Development References: <09ef54b2-a6b1-5bf5-8562-f2f436fd4d92@processus.org> <9BF1EB68-3F1F-4FBF-A87F-FADF98B09E4A@9dev.de> Message-ID: Date: Wed, 3 Mar 2021 13:44:04 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Authentication-Results: processus.org; auth=pass smtp.auth=pierre-php@processus.org smtp.mailfrom=pierre-php@processus.org X-Spamd-Bar: / Subject: Re: [PHP-DEV] Add __toString() to DateInterval From: pierre-php@processus.org (Pierre) Le 03/03/2021 à 13:05, Hans Henrik Bergan a écrit : > if FWIW if DateTime::__toString() was just > function __toString():string{ > return $this->format(\DateTime::RFC3339); > } > > i certainly wouldn't complain. > > On Wed, 3 Mar 2021 at 12:16, Bruce Weirdan wrote: Considering the replies, PHP Date(Time|Interval) API could probably born again from a nice cleanup/improvements iteration. The one thing I miss the most is not having a Date (especially for when you fetch dates from SQL, and you don't care about TZ handling, you may very bad surprises using a DateTime to reprensent it on the PHP side due to potential implicit TZ conversion, which may create +1 or -1 decal in your dates, either at instance creation or display), along with a Time type, and DateTime being an aggregate of the two altogether. -- Pierre