Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57087 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70540 invoked from network); 24 Dec 2011 15:04:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Dec 2011 15:04:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@googlemail.com X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:61985] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/3D-16446-8F9E5FE4 for ; Sat, 24 Dec 2011 10:04:24 -0500 Received: by lagj5 with SMTP id j5so4053435lag.29 for ; Sat, 24 Dec 2011 07:04:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=C+E2Op8+i1FZn+FJXiRo+wf1zyN8ZUz+lOqbu03Dqzs=; b=Q9Nmp1UCMWv8Vwxj587y5tHviEHSVYzzYnB5s2mG0Ew9JI/ohqNcHsR9VGfNPIJ11a 6tD0SAJZTay4uh7pmiL28myUHi1zOoRLVB5LqGzqlADR0FnbRNzntSHQRWVF7QaFJv0Q paHovO3ysAu1vCe2YrO8xYMpf/d+qxG/cLSUc= MIME-Version: 1.0 Received: by 10.152.112.41 with SMTP id in9mr14993298lab.27.1324739059037; Sat, 24 Dec 2011 07:04:19 -0800 (PST) Received: by 10.152.108.110 with HTTP; Sat, 24 Dec 2011 07:04:19 -0800 (PST) In-Reply-To: References: Date: Sat, 24 Dec 2011 16:04:19 +0100 Message-ID: To: Pierre Joye Cc: Derick Rethans , =?ISO-8859-1?B?QW5kcukgUvhtY2tl?= , PHP Developers Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] REQUEST_TIME change in PHP 5.4 From: nikita.ppv@googlemail.com (Nikita Popov) You missed the @ before the number ;) On Sat, Dec 24, 2011 at 4:00 PM, Pierre Joye wrote: > 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} > =A0thrown 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} > =A0thrown 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} > =A0thrown in Command line code on line 1 > > Cheers, > -- > Pierre > > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >