Home > Archive > PHP Questions and Answers > April 2007 > Re: [PHP-DEV] ZF 0.8.0 Unit Tests behaving different on PHP 5.2.1
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [PHP-DEV] ZF 0.8.0 Unit Tests behaving different on PHP 5.2.1
|
|
| Antony Dovgal 2007-04-14, 6:57 pm |
| On 04/14/2007 08:50 PM, Sebastian Nohn wrote:
> On PHP 5.2.1, ZendFramework 0.8.0 Unit Tests pass, while they fail on
> PHP 5.2.2-dev (latest CVS) on the same machine:
>
> 1) testDate(Zend_Date_DateObjectTest)
> Failed asserting that <string:6900000000> is identical to <string:6.9E+9>
> .../tests/Zend/Date/DateObjectTest.php:408
Would be nice to have a short but complete reproduce case.
Referring to some test (which I personally have never seen) is not really helpful.
> This behaviour is also reproducable on Zend Framework trunk.
>
> I don't know, where the bug is (ZF or PHP), so it would be nice, if PHP
> and ZF developers could come together to solve this.
>
> - Sebastian
>
--
Wbr,
Antony Dovgal
| |
| Sebastian Nohn 2007-04-15, 3:57 am |
| On Sat, April 14, 2007 8:29 pm, Antony Dovgal wrote:
> On 04/14/2007 08:50 PM, Sebastian Nohn wrote:
>
> Would be nice to have a short but complete reproduce case.
> Referring to some test (which I personally have never seen) is not really
> helpful.
This was the idea why PHP and ZF developers should come together. However,
I investigated the issue and here is a small testcase:
<?php
$a = 6900000000;
var_dump($a);
$b = "A is: ".$a;
var_dump($b);
?>
5.2.1 output is:
float(6.9E+9)
string(16) "A is: 6900000000"
5.2.2-dev output is:
float(6.9E+9)
string(12) "A is: 6.9E+9"
- Sebastian
| |
| Antony Dovgal 2007-04-16, 3:57 am |
| On 04/15/2007 11:05 AM, Sebastian Nohn wrote:
> <?php
> $a = 6900000000;
> var_dump($a);
> $b = "A is: ".$a;
> var_dump($b);
> ?>
>
> 5.2.1 output is:
>
> float(6.9E+9)
> string(16) "A is: 6900000000"
>
> 5.2.2-dev output is:
>
> float(6.9E+9)
> string(12) "A is: 6.9E+9"
Nice catch, thanks.
What do you think is the most correct output for 1 000 000 000 000 000 (with precision = 14)?
Versions <= 5.2.1 output "1E+15", 5.2.2 says "1.0E+15".
Both options looks ok to me, but we need to decide which one is the best.
I can find pros/cons for both options myself and it doesn't matter for me which one is chosen, though somebody might.
I remember asking people on the channel and the most popular answer was "both are legal and look ok".
Opinions?
--
Wbr,
Antony Dovgal
| |
| Sebastian Nohn 2007-04-16, 7:57 am |
| On Mon, April 16, 2007 10:10 am, Antony Dovgal wrote:
> On 04/15/2007 11:05 AM, Sebastian Nohn wrote:
>
> Nice catch, thanks.
>
> What do you think is the most correct output for 1 000 000 000 000 000
> (with precision = 14)?
> Versions <= 5.2.1 output "1E+15", 5.2.2 says "1.0E+15".
Whatever is done, if the result is a different behaviour between 5.2.1 and
5.2.2, it needs to be documented in the change log / release notes.
- Sebastian
|
|
|
|
|