Zend Framework

getDate() expects parameter 1 to be long, string given in DateObject.php line 667

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: 1.8.4
  • Fix Version/s: None
  • Component/s: Zend_Date
  • Labels:
    None

Description

Alias : ZF-7185 and ZF-6859

By looking better, the problem is that getUnixTimestamp() (class DateObject) send an empty string when this-> _ unixTimestamp equals null, while getdate() waits null value and not empty string.

A correction which I propose is simple. It is enough to add a line in getUnixTimestamp() , which becomes:

Unable to find source-code formatter for language: php. Available languages are: javascript, sql, xhtml, actionscript, none, html, xml, java
protected function getUnixTimestamp()
    {
        if($this->_unixTimestamp === null) return null;

        if ($this->_unixTimestamp === intval($this->_unixTimestamp)) {
            return (int) $this->_unixTimestamp;
        } else {
            return (string) $this->_unixTimestamp;
        }
    }

Issue Links

Activity

Hide
Dolf Schimmel (Freeaqingme) added a comment -

This issue duplicates two issues. If you believe there's still an issue (with the latest version, 1.8.4) please reopen one of these issues instead of creating a new one.

Closing this one as duplicate.

Show
Dolf Schimmel (Freeaqingme) added a comment - This issue duplicates two issues. If you believe there's still an issue (with the latest version, 1.8.4) please reopen one of these issues instead of creating a new one. Closing this one as duplicate.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: