Re: REQUEST_TIME change in PHP 5.4

From: Date: Sat, 24 Dec 2011 15:00:09 +0000
Subject: Re: REQUEST_TIME change in PHP 5.4
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-57086@lists.php.net to get a copy of this message
On Sat, Dec 24, 2011 at 12:55 PM, Derick Rethans <derick@php.net> 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

« previous php.internals (#57086) next »