php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #61522 E_STRICT for compatibility TZs
Submitted: 2012-03-27 02:48 UTC Modified: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: a at b dot c dot de Assigned:
Status: Open Package: Date/time related
PHP Version: 5.4.0 OS: generic
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
40 + 14 = ?
Subscribe to this entry?

 
 [2012-03-27 02:48 UTC] a at b dot c dot de
Description:
------------
A bunch of the Timezones supported by PHP come with a warning in the manual: "Please do not use any of the timezones listed here (besides UTC), they only exist for backward compatible reasons."

I'd just like to suggest having functions that take timezone strings as arguments (such as date_default_timezone_set) trigger an E_STRICT notice when passed one of these compatibility zone names.

Should the list change in future, this could give developers a heads-up.


Test script:
---------------
<?php
date_default_timezone_set('EST');
?>

Expected result:
----------------
PHP Strict Standards:  Use of compatibility Timezone ID 'EST' should be replaced with current name in test.php on line 2.


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Sep 17 00:01:27 2019 UTC