Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57086 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69114 invoked from network); 24 Dec 2011 15:00:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Dec 2011 15:00:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.170 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.161.170 mail-gx0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:35561] helo=mail-gx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/EC-16446-DF8E5FE4 for ; Sat, 24 Dec 2011 10:00:14 -0500 Received: by ggnv1 with SMTP id v1so7792781ggn.29 for ; Sat, 24 Dec 2011 07:00:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3jmhTAuhBS0dkmfitPCcue1h+7fXsSfH4gXQnOgCqOs=; b=PwPKbz9XnH7bDBwLvmSONBUGYuAQvaz2qBf05LDH1pwdoGCGYBw5Kakb2GSTbwWa88 5TQn+sSOATVKkT8dmExvoFniFH1ttdk38sdPzkowm5vgyLUUW43UpqM1fx6UsypHaGUF 3Gbl87GdU+xd6b/8TQgr5Sxc+NoQDNYjLntcI= MIME-Version: 1.0 Received: by 10.101.137.19 with SMTP id p19mr696133ann.70.1324738809494; Sat, 24 Dec 2011 07:00:09 -0800 (PST) Received: by 10.146.204.6 with HTTP; Sat, 24 Dec 2011 07:00:09 -0800 (PST) In-Reply-To: References: Date: Sat, 24 Dec 2011 16:00:09 +0100 Message-ID: To: Derick Rethans Cc: =?ISO-8859-1?B?QW5kcukgUvhtY2tl?= , PHP Developers Mailing List Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] REQUEST_TIME change in PHP 5.4 From: pierre.php@gmail.com (Pierre Joye) On Sat, Dec 24, 2011 at 12:55 PM, Derick Rethans wrote: > new DateTime("@{$_SERVER['REQUEST_TIME']}"); f.e. Not following you here, how does it work better in 5.3.x? It is a float but datetime fails just like before. php536nts>php -n -r "var_dump($_SERVER['REQUEST_TIME']);new Datetime($_SERVER['REQUEST_TIME']);" int(1324738540) Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1324738540) at position 8 (4): Unexpected character' in Command line code:1 Stack trace: #0 Command line code(1): DateTime->__construct('1324738540') #1 {main} thrown in Command line code on line 1 5.3.9rc4>php -n -r "var_dump($_SERVER['REQUEST_TIME']);new Datetime($_SERVER['REQUEST_TIME']);" int(1324738655) Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1324738655) at position 8 (5): Unexpected character' in Command line code:1 Stack trace: #0 Command line code(1): DateTime->__construct('1324738655') #1 {main} thrown in Command line code on line 1 and with 5.4.0RC4: 5.4.0rc4-nts>php -n -r "var_dump($_SERVER['REQUEST_TIME']);new Datetime($_SERVER['REQUEST_TIME']);" float(1324738763.2993) Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1324738763.2993) at position 8 (6): Unexpected character' in Command line code:1 Stack trace: #0 Command line code(1): DateTime->__construct('1324738763.2993') #1 {main} thrown in Command line code on line 1 Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org