|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-08-25 08:36 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 11:00:02 2025 UTC |
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'; } ----------------------- SorrySorry 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'; }