php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59107 Date read from amf as double not int64
Submitted: 2010-03-10 10:53 UTC Modified: 2017-04-01 19:22 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: ssufficool at gmail dot com Assigned:
Status: Wont fix Package: amfext (PECL)
PHP Version: Irrelevant OS: Ubuntu Linux 9.10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
50 + 11 = ?
Subscribe to this entry?

 
 [2010-03-10 10:53 UTC] ssufficool at gmail dot com
Description:
------------
teh serialized date is read from an AMF stream as a double and then re-ordered as big endian instead of being read as an int64 per the spec. The double is unusable in PHP as a date anyhow.

Reproduce code:
---------------
$amf = amf_decode($amfstream);
echo $amf['date'];

Expected result:
----------------
An integer or double value that is usable in PHP

Actual result:
--------------
3.123456789E-306

--- SOLUTION?  ---
For PHP5.x read the int64, convert from milliseconds to seconds and return as ZVAL_LONG with a big fat note of the precision loss.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-01 19:22 UTC] tpunt@php.net
-Status: Open +Status: Wont fix
 [2017-04-01 19:22 UTC] tpunt@php.net
Due to this extension not seeing any activity since 2010, this issue will not be fixed. We are therefore closing this now.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 02:01:29 2024 UTC