php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20527 unixdate
Submitted: 2002-11-20 18:51 UTC Modified: 2002-11-21 02:58 UTC
From: davidegiunchi at libero dot it Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4CVS-2002-11-20 (dev) OS: Linux 2.4.19
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: davidegiunchi at libero dot it
New email:
PHP Version: OS:

 

 [2002-11-20 18:51 UTC] davidegiunchi at libero dot it
PHP Fatal error:  Cannot redeclare unixdate() in /web/htdocs/home/pnadodb/adodb.inc.php on line 147

Here it's the code that generate the error:
--------
        /**
         * Also in ADORecordSet.
         * @param $v is a date string in YYYY-MM-DD format
         *
         * @return date in unix timestamp format, or 0 if before TIMESTAMP_FIRST_YEAR, or false if invalid date format
         */
        function UnixDate($v)
        {
                if (!preg_match( "|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})|",
                        ($v), $rr)) return false;

                if ($rr[1] <= TIMESTAMP_FIRST_YEAR) return 0;
                // h-m-s-MM-DD-YY
                return mktime(0,0,0,$rr[2],$rr[3],$rr[1]);
        }
----------------
The funcion is called in this way:
---
else $d = ADOConnection::UnixDate($d);
--------

The same program works find with Apache1.3.27+php-4.2.3 

You can try this program at http://php.weblogs.com/ADODB
it's named "ADOdb Library for PHP"

Regards.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-21 02:44 UTC] jan@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

you\'re most likely have a double inclusion mixup. make sure, that in the code you run UnixDate is declared only once.
 [2002-11-21 02:58 UTC] alan_k@php.net
its a bug in the adobdb.inc.php file - it declares unixdate twice in version 2.43, looks like it is fixed in 2.5

php4.3 will now produce errors if you declare a method more than once in the same class.. (previous versions of php did not)

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 13:01:28 2025 UTC