php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54102 Conflicts of regular expressions in parse_date.re
Submitted: 2011-02-25 18:15 UTC Modified: -
From: tomas dot brastavicius at quantum dot lt Assigned:
Status: Open Package: Date/time related
PHP Version: 5.3.6RC1 OS: Ubuntu
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:
14 + 50 = ?
Subscribe to this entry?

 
 [2011-02-25 18:15 UTC] tomas dot brastavicius at quantum dot lt
Description:
------------
Regular expression year4 conflicts with gnunocolon, and pointeddate2 with both timelong12 and timelong24.

Test script:
---------------
<?php
echo date("Y-m-d H:i:s", strtotime("2460")) . "\n";	// year4 was used
echo date("Y-m-d H:i:s", strtotime("2011")) . "\n";	// gnunocolon was used
echo date("Y-m-d H:i:s", strtotime("20.02.99")) . "\n";	// pointeddate2 was used
echo date("Y-m-d H:i:s", strtotime("20.02.11")) . "\n";	// timelong24 was used

Expected result:
----------------
Used single regular expression independently on date/time range

Actual result:
--------------
2460-02-25 15:17:46
2011-02-25 20:11:00
1999-02-20 00:00:00
2011-02-25 20:02:11


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 05:01:27 2019 UTC