Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124354 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id C84831A00B7 for ; Wed, 10 Jul 2024 15:48:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720626613; bh=7mCQK93n1B9AtnkVg8m6Ik3YXiQ4dB/qXxH4KSbKVfg=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=d5DW+4aZV6iknMC6NPjVLcoLgZ79fnuR3nAJzk9ZXmbAH9ho+X/PnVqaGtFtdLmp5 o7kKPX6rzhzK/yE5Zmp3kJ39eHHAISv+K7K5eCxP9RJRwepB/maR4IvX2wF7kunJRQ 0ocYqpfZ4r3U9jycyBoriMxmauMpG0O+VLLtFLMj/++b3YylcIgVh5ZtqZVFkv8fUP 2fze64337IIMsNzF3yDehNKQqut+J9PNIIqyn6VTxHtKAJar3iV2uGG8jEcG2pI5Tz z5XsQhhbO8zjU3gPYeCb9tYiTPuxdioO6nej+69FkKGnikVcUmmlvqpD8Y2IUa0iW2 3dmX8eUKgx4aA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D7908180C13 for ; Wed, 10 Jul 2024 15:50:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: *** X-Spam-Status: No, score=3.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_PASS, SPF_SOFTFAIL autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from xdebug.org (xdebug.org [82.113.146.227]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 10 Jul 2024 15:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720626523; bh=7mCQK93n1B9AtnkVg8m6Ik3YXiQ4dB/qXxH4KSbKVfg=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=ZgtJ6WET5FCL9pGjendLa1MMooEtPGakT6E/WPvXugLGVBiIVkRegKZhhdlorcPhG cSr0j4Umo/nbLnqZ5guT+OxETGiZ5XBPP2ySimW1FTjmf4EE3OAj1Vo6sYMEwp/bpJ BPaWY8lq2BFkuHOtGx1+uTRJze5BHkFuWVGaS74x/wfwNBIeXmZvqVCTwcAxNk0Vtd cshKMNSy9O41S2aIfIkA2wWtPBASTkzfTpwFkxRPkOciiqY8+RcmgHaAobmOZjKJr1 4fo578FbXy8HzRy7a2oFhjikH++A4LctDAWgdR5ZInMgfspwVs8Ffip+362fGOKPk6 UWHVbzJ1TZUfQ== Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 70CFD10C17D; Wed, 10 Jul 2024 16:48:43 +0100 (BST) Date: Wed, 10 Jul 2024 16:48:43 +0100 (BST) To: Go Kudo cc: PHP internals Subject: Re: [PHP-DEV] [Discussion] Add date_test_set_now() function In-Reply-To: Message-ID: References: Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII From: derick@php.net (Derick Rethans) On Mon, 1 Jul 2024, Go Kudo wrote: > So, how about adding a `date_set_test_now(\DateInterval > $shiftInterval)` function to ext-date? > > This function would treat the current time as shifted by the passed > DateInterval. Since it's implemented on the ext-date side, there's no > need for dirty hacks using usleep. It's not that easy, as maney calculations are done in "timelib". Especially for shifting times with relative times, the parser will need to understand that too I suppose. I am not keen on adding this global override to this library. cheers, Derick