|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70580 Test Zend/tests/bug42143.phpt is broken
Submitted: 2015-09-25 11:59 UTC Modified: 2018-08-05 22:54 UTC
Avg. Score:2.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: rainer dot jung at kippdata dot de Assigned:
Status: Re-Opened Package: Testing related
PHP Version: 7.0.0RC3 OS: Solaris
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-09-25 11:59 UTC] rainer dot jung at kippdata dot de
The test Zend/tests/bug42143.phpt contains:

     13 var_dump(log10(-1) == log(-1));
     14 var_dump(log10(-1) != log10(-1));

On Linux, that test works, because the logarithm of -1 returns NAN as expected. On Solaris the log returns -INF and that part of the test fails. This behavior is allowed by the specifications: See in

"For finite values of x that are less than 0 ..., a domain error shall occur, and either a NaN (if supported), or an implementation-defined value shall be returned."

Since there are a lot of other but similar tests in Zend/tests/bug42143.phpt, I suggest to drop these two lines.

See attached patch.


Zend-log-nana-fix-test-bug42143 (last revision 2015-09-25 12:00 UTC by rainer dot jung at kippdata dot de)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-09-25 12:05 UTC] rainer dot jung at kippdata dot de
This applies also to PHP 5.4-5.6 (latest releases).
 [2015-10-24 04:48 UTC]
Now its been a while with proper testing writing, but I think its possible that we change the EXPECT section to EXPECTF and then have something like: %NaN|INF% or similar, I should probably consult run-tests.php for this, but it seems most reasonable we keep the test for most code path coverage.
 [2018-08-05 05:00 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: carusogabriel
 [2018-08-05 05:00 UTC]
Closing as this tests isn't failing anymore:
 [2018-08-05 14:20 UTC]
-Status: Closed +Status: Re-Opened
 [2018-08-05 14:20 UTC] runs on CentOS 6[1], so the test is likely to
succeed. The report is about the test failing on Solaris, which
still might be the case.

I agree with Rainer, that the two lines should be dropped.
Kalle's argument to keep the lines for better code coverage is
somewhat moot, since our log() and log10() implementations are
thin wrappers over C's log() and log10(), respectively, so
basically we're testing implementation defined behavior here.

[1] <>
 [2018-08-05 16:43 UTC]
@cmb My apologies, I didn't pay attention to that detail. I'll try to emulate Solaris locally and see if we can fix, or drop those lines as suggested.

Btw, thanks for the Wiki Systems link (, I didn't know about it.
 [2018-08-05 20:41 UTC]
How about ignore the test on Solaris by using PHP_OS constant. i.e. Use SKIPIF
Skipping all tests in the .phpt is nonsense, so create new .phpt and move offending tests to it.

I guess PHP_OS would be "Solaris". I don't have solaris. Someone using solaris should write phpt and test it.
 [2018-08-05 22:54 UTC]
-Assigned To: carusogabriel +Assigned To:
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 18 10:01:29 2024 UTC