# ZF 0.8.0 Unit Tests behaving different on PHP 5.2.1 and PHP 5.2.2-dev

- Thread: https://externals.io/message/28826
- Original archive: https://news-web.php.net/php.internals/28826
- Started by Sebastian Nohn on 2007-04-14T16:50:58+00:00
- Messages: 10
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #28826 — Sebastian Nohn — 2007-04-14T16:50:58+00:00

URL: https://externals.io/message/28826#28826

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

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

---

## #28833 — Antony Dovgal — 2007-04-14T18:29:20+00:00

URL: https://externals.io/message/28826#28833 · In reply to: #28826

> 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

---

## #28843 — Sebastian Nohn — 2007-04-15T07:05:36+00:00

URL: https://externals.io/message/28826#28843 · In reply to: #28833

> 
> > […]
>
> 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

---

## #28850 — Antony Dovgal — 2007-04-16T08:10:44+00:00

URL: https://externals.io/message/28826#28850 · In reply to: #28843

> <?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

---

## #28851 — Tijnema ! — 2007-04-16T08:19:01+00:00

URL: https://externals.io/message/28826#28851 · In reply to: #28850

> 
> > […]
>
> 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

The second one "1.0E+15" is more precise, as it has the extra 0. Other
than that there's no big difference between them. But because it was
in 5.2.1 and before, it might be better to choose the first one.

Tijnema

---

## #28852 — Sebastian Nohn — 2007-04-16T08:32:31+00:00

URL: https://externals.io/message/28826#28852 · In reply to: #28850

> 
> > […]
>
> 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

---

## #28863 — thomas.weidner@gmx@"Thomas Weidner — 2007-04-16T17:57:12+00:00

URL: https://externals.io/message/28826#28863 · In reply to: #28852

Sebastian,

it should also be mentioned that when you are refferring to a test within ZF 
you should always look
against the latest version of ZF.

Since 0.8 I've fixed several issues for the I18N core and about 2000 lines 
of code have changed only for I18N which you are referring with 
Zend_Date_Dateobject-Tests.

Independent on why this failure is there I also have to mention that I think 
that we will not fix issues within ZF which are raised due to the 
development tree of a php version. If php 5.2.2 is released and we have an 
issue with it we will fix it, but as this php version will probably be 
changed until it's release it would be nonsense to fix bugs which may be not 
in there when the new version of php is released.

But keep your good work going... you've already found some nasty bugs which 
have been fixed ;-)

Greetings
Thomas
I18N Team Leader for the Zend Framework


----- Original Message ----- 
From: "Sebastian Nohn" <sebastian@nohn.net>
To: "Antony Dovgal" <antony@zend.com>
Cc: "Sebastian Nohn" <sebastian@nohn.net>; "Zend Framework General" 
<fw-general@lists.zend.com>; <ilia@php.net>; <php-qa@lists.php.net>; 
<internals@lists.php.net>
Sent: Monday, April 16, 2007 10:32 AM
Subject: [fw-general] Re: [PHP-DEV] ZF 0.8.0 Unit Tests behaving different 
on PHP 5.2.1 and PHP 5.2.2-dev


> 
> > […]
>
> 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

---

## #28924 — Antony Dovgal — 2007-04-19T09:33:54+00:00

URL: https://externals.io/message/28826#28924 · In reply to: #28843

> <?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"

Fix committed, please test the next snapshot.

-- 
Wbr, 
Antony Dovgal

---

## #28925 — Sebastian Nohn — 2007-04-19T11:27:51+00:00

URL: https://externals.io/message/28826#28925 · In reply to: #28924

Hi,


> 
> > […]
>
> Fix committed, please test the next snapshot.

Works! Thanks a lot!

- Sebastian

---

## #28926 — Antony Dovgal — 2007-04-19T11:33:07+00:00

URL: https://externals.io/message/28826#28926 · In reply to: #28925

> Hi,
> > […]
> 
> Works! Thanks a lot!

Thanks you for letting us know =)

-- 
Wbr, 
Antony Dovgal
