Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113599 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 40918 invoked from network); 18 Mar 2021 09:36:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Mar 2021 09:36:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B1E331804B8 for ; Thu, 18 Mar 2021 02:30:32 -0700 (PDT) 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.3 required=5.0 tests=BAYES_05,DKIM_INVALID, DKIM_SIGNED,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail.hades.9dev.de (mail.hades.9dev.de [88.99.187.36]) (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, 18 Mar 2021 02:30:31 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 473485E04A; Thu, 18 Mar 2021 10:30:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9dev.de; s=dkim; t=1616059830; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=stt9IjBCACL4dV3e63R2jHS0w3oEzYct0m+p4cDti3s=; b=RMtqz1Vdvh8SeSFz9egIumpTryC9Y757vyanUZmmeldvhnG+l9GuH0/+Ans0/v35H31dRz xHT3rlZkreKOaDwIlBC8eL374KHR9f0wuqrd0XCAR4muKgdXblvul0dNTdkp0D9hE/a5sX PUxQJh6joY+Hxus4fFhUS2GXuez+uu3nnqdsRyJIbTVKQFhBWVbE6xyWxHQqh31Ii1lNFw 3azbLTLViZpJMJWBjScgQFrafGaYTpjdTJ4U++8/IUSi/7vhBmUt9eLrmO7JEAHjCjBf8y jMu/O/0AXVt1f+i9E8G8+b4Q86+374i02QNqb9L4qE0G1aWnJUres9+WNyeuaQ== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) In-Reply-To: <5a226984-dc4e-535a-ba01-62daacbe2107@gmail.com> Date: Thu, 18 Mar 2021 10:30:25 +0100 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <03009BCE-853A-4007-A6F2-DB6800C37AD9@9dev.de> References: <05166649-DFD5-4B93-8D4C-1E19CE129EFF@9dev.de> <5a226984-dc4e-535a-ba01-62daacbe2107@gmail.com> To: Rowan Tommins X-Last-TLS-Session-Version: TLSv1.2 Subject: Re: [PHP-DEV] Add __toString() to DateInterval From: m@9dev.de (Moritz Friedrich) > Would a reasonable way forward be to have such a named method, and = have it throw an exception if the instance is not representable in that = form? >=20 > That way, you'd be guaranteed that new = DateInterval($period->toIsoPeriodString()) would result in an equivalent = object, rather than discarding special relative values. Yep, this sounds like a good idea. Derick, would this work for you? Regards, Moritz=