php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42671 ext/standard/tests/time/002.phpt fails due to AIX not supporting TZ=US/Eastern
Submitted: 2007-09-14 14:50 UTC Modified: 2007-10-02 11:58 UTC
From: ppryor at pobox dot com Assigned:
Status: Wont fix Package: Date/time related
PHP Version: 4.4.7 OS: AIX 5.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ppryor at pobox dot com
New email:
PHP Version: OS:

 

 [2007-09-14 14:50 UTC] ppryor at pobox dot com
Description:
------------
The test script, ext/standard/tests/time/002.phpt always fails on AIX because AIX does not support setting of TZ to US/Eastern, and the if statement that checks for this situation fails.

Orignal code in test case:

        putenv("TZ=US/Eastern");

        if( date("T") == "GMT" ) {
                // POSIX style
                putenv ("TZ=EST5EDT4,M4.1.0,M10.5.0");
        }

should be modified as follows:

        putenv("TZ=US/Eastern");

        if( date("T") == "GMT" || date("T") == "   " ) {
                // POSIX style
                putenv ("TZ=EST5EDT4,M4.1.0,M10.5.0");
        }

Then it will pass the test. IMHO this problem applies to several platforms, not just AIX. The function date("t") could return a string of three spaces under certain circumstances.

Reproduce code:
---------------
base=`pwd`
cd ext/standard/tests/time
export TEST_PHP_EXECUTABLE=$base/sapi/cli/php
$TEST_PHP_EXECUTABLE $base/run-tests.php 002.phpt

Expected result:
----------------
=====================================================================
CWD         : /home/ppryor/php-4.4.7/ext/standard/tests/time
PHP         : /home/ppryor/php-4.4.7/sapi/cli/php 
PHP_SAPI    : cli
PHP_VERSION : 4.4.7
ZEND_VERSION: 1.3.0
PHP_OS      : AIX - AIX EFT_QA02 2 5 00015D2A4C00
INI actual  : 
More .INIs  : 
Extra dirs  : 
=====================================================================
Running selected tests.
PASS strtotime() function [002.phpt]


Actual result:
--------------
=====================================================================
CWD         : /home/ppryor/php-4.4.7/ext/standard/tests/time
PHP         : /home/ppryor/php-4.4.7/sapi/cli/php 
PHP_SAPI    : cli
PHP_VERSION : 4.4.7
ZEND_VERSION: 1.3.0
PHP_OS      : AIX - AIX EFT_QA02 2 5 00015D2A4C00
INI actual  : 
More .INIs  : 
Extra dirs  : 
=====================================================================
Running selected tests.
FAIL strtotime() function [002.phpt]


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-14 15:04 UTC] ppryor at pobox dot com
I found same problem with ext/standard/tests/time/bug13142.phpt, so I modified the test case as follows:

Original

putenv("TZ=US/Eastern");
if (date('T') == 'GMT') {
        putenv("TZ=EST5EDT4,M4.1.0,M10.5.0");
}

Revised

putenv("TZ=US/Eastern");
if (date('T') == 'GMT' || date('T') == '   ') {
        putenv("TZ=EST5EDT4,M4.1.0,M10.5.0");
}

Then it will pass the test.
 [2007-10-02 11:58 UTC] tony2001@php.net
Forget about 4.4.7, there is no point in fixing something that will become officially unsupported in a couple of months.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 17:01:31 2024 UTC