Re: [PHP-DEV] Re: bug 52062

2012-01-04 Thread Derick Rethans
On Tue, 27 Dec 2011, Stas Malyshev wrote:

> > 3. $d->setTimestamp(1000) is not ever going to work as
> > zend_parse_parameters simply gives me long: 1215752192. This I find
> > really strange actually. Any clue?
> 
> That's probably float to long conversion, since 1000 is float on
> 32-bit.

Well, it isn't. Set a breakpoint on date_timestamp_set() and see what it 
does. It's really quite weird with what zend_parse_parameters does.

Derick

-- 
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Re: bug 52062

2011-12-27 Thread Stas Malyshev

Hi!


3. $d->setTimestamp(1000) is not ever going to work as
zend_parse_parameters simply gives me long: 1215752192. This I find
really strange actually. Any clue?


That's probably float to long conversion, since 1000 is float on 
32-bit.


--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: bug 52062

2011-12-27 Thread Derick Rethans
On Sun, 25 Dec 2011, Stas Malyshev wrote:

> I see that test for bug 52062 (marked as fixed by this commit:
> http://svn.php.net/viewvc/?view=revision&revision=320481) now fails on my
> 32-bit system. Looking at the patch and the test, it can not actually succeed,
> as the test expects this:
> int(1000)
> which is not possible on 32-bit system, and the code actually compares the
> result to LONG_MAX which is 32-bit and returns false when it's bigger that
> that. So I'd like to know what was the intent there:
> 
> 1. Return false on 32-bit and the test should be fixed to account for 32-bit
> and 64-bit?
> 2. Return float on 32-bit?
> 3. Do something else?
> 
> Please advise.

There are several issues here:

1. The test was wrong, the result for var_dump($d->getTimestamp());
   should indeed have been bool: false; I've a patch for this.
2. DateInterval::format() didn't handle large ints succesfully; I 
   have a patch for this too.
3. $d->setTimestamp(1000) is not ever going to work as 
   zend_parse_parameters simply gives me long: 1215752192. This I find 
   really strange actually. Any clue?

cheers,
Derick

-- 
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php