Bug #75119 [Opn->Csd]: function timezone_identifiers_list returns Asia/Rangoon but not Asia/Yangon

From: Date: Fri, 25 Aug 2017 09:00:32 +0000
Subject: Bug #75119 [Opn->Csd]: function timezone_identifiers_list returns Asia/Rangoon but not Asia/Yangon
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210807@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75119&edit=1

 ID:                 75119
 User updated by:    michele dot carino84 at gmail dot com
 Reported by:        michele dot carino84 at gmail dot com
 Summary:            function timezone_identifiers_list returns
                     Asia/Rangoon but not Asia/Yangon
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            Date/time related
-Operating System:   Any
+Operating System:   Ubuntu 16.10
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

I'm going to close this bug, because it is an OS problem, but, what happen if I deploy code on
another machine with another list of tz ids?


Previous Comments:
------------------------------------------------------------------------
[2017-08-25 08:43:43] michele dot carino84 at gmail dot com

Sorry again, some errors in test script written two times with errors, definitively should be:

<?php

if (in_array('Asia/Yangon', timezone_identifiers_list())) {
    echo 'Asia/Yangon returned';
} else {
    echo 'Asia/Yangon not returned';
}

if (in_array('Asia/Rangoon', timezone_identifiers_list())) {
    echo PHP_EOL . 'Asia/Rangoon returned';
} else {
    echo PHP_EOL . 'Asia/Rangoon not returned';
}

------------------------------------------------------------------------
[2017-08-25 08:41:13] michele dot carino84 at gmail dot com

Test script should be

<?php

if (in_array('Asia\Yangon', timezone_identifiers_list())) {
    echo 'Asia\Yangon returned';
} else {
    echo 'Asia\Yangon not returned';
}

if (in_array('Asia\Rangoon', timezone_identifiers_list())) {
    echo PHP_EOL . 'Asia\Rangoon returned';
} else {
    echo PHP_EOL . 'Asia\Rangoon not returned';
}

-----------------------
Sorry

------------------------------------------------------------------------
[2017-08-25 08:36:21] michele dot carino84 at gmail dot com

Description:
------------
According to IANA Asia/Rangoon is only a link for Asia/Yangon.
The function timezone_identifiers_list returns only Asia/Rangoon.

The documentation of the function does not specifies that it's going to return only some of the
available ids so the user expectation is to have at least main ids, instead of secondary linked
ones.

A documentation change would make easy to understand what the function returns.
And also all of the primary ids should be returned.

Test script:
---------------
<?php

if (!in_array('Asia\Yangon', timezone_identifiers_list())) {
    echo 'Asia\Yangon not returned';
}

if (!in_array('Asia\Rangoon', timezone_identifiers_list())) {
    echo PHP_EOL . 'Asia\Rangoon returned';
}



Expected result:
----------------
# if the intent of the function is to return only IANA primary ids

Asia\Yangon returned
Asia\Rangoon not returned 

# else if the intent of the function is to return all of the ids


Asia\Yangon returned
Asia\Rangoon returned 


Actual result:
--------------
Asia\Yangon not returned
Asia\Rangoon returned 


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75119&edit=1


Thread (4 messages)

« previous php.bugs (#210807) next »