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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC