#48276 [Asn->Csd]: date('Y') returns 0000
| From: | scottmac@php.net | Date: | Sun, 21 Jun 2009 22:20:04 +0000 |
| Subject: | #48276 [Asn->Csd]: date('Y') returns 0000 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-138601@lists.php.net to get a copy of this message | ||
ID: 48276
Updated by: scottmac@php.net
Reported By: info at programmiernutte dot net
-Status: Assigned
+Status: Closed
Bug Type: Date/time related
Operating System: Mac OS X 10.4 PPC
PHP Version: 5.3.0RC2
-Assigned To: derick
+Assigned To: scottmac
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
The year was a long long, but we were printing it like a long. Since
sparc and ppc are big endian it was grabbing the wrong bits so to speak
:)
Previous Comments:
------------------------------------------------------------------------
[2009-06-21 11:17:49] rleeden at gmail dot com
Also, seeing this after upgrading from 5.2.9 to 5.2.10.
On Solaris Sparc version 9.
<?=date(Y); ?>
returns 0000 on 5.2.10
and returns 2009 as expected on 5.2.9
------------------------------------------------------------------------
[2009-06-20 15:15:41] xserve at web dot de
This bug still exits in the same way with PHP 5.2.10.
Found after upgrade from 5.2.9 to 5.2.10 on a Mac OS X 10.4.11 Server
PPC.
With 5.2.9
<?=date(Y); ?>
works as expected.
------------------------------------------------------------------------
[2009-05-28 10:07:22] derick@php.net
Seems like it's an issue in slprintf:
1017 switch (format[i]) {
(gdb)
1043 timelib_sll year = PHP_LLABS(t->y);
(gdb) print year
$1 = 1230768000
(gdb) next
1044 length = slprintf(buffer, 32, "%s%04ld", t->y < 0 ? "-" :
"",
year); break;
(gdb) print year
$2 = 2009
(gdb) next
1124 smart_str_appendl(&string, buffer, length);
(gdb) print buffer
$3 =
"0000\000\000\004\202\000\000\000\000\000\000\000\000I\\\a\200\000\000\000\000\000\000\0006\000\000\000\000"
(gdb) next
1015 for (i = 0; i < format_len; i++) {
(gdb) print &string
$4 = (smart_str *) 0xffa1cde0
(gdb) print string
$5 = {c = 0x1071f060 "0000\020q�X\020c\003�", len = 4, a = 78}
------------------------------------------------------------------------
[2009-05-28 08:42:28] derick@php.net
Oh, I had forgotten about that PPC machine. I'll have a look.
------------------------------------------------------------------------
[2009-05-28 03:56:41] scottmac@php.net
We have a PPC test machine, Derick has access and I can set up other
accounts if needed.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/48276
--
Edit this bug report at http://bugs.php.net/?id=48276&edit=1