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

Issue Type: Bug Created: 2009-07-03T05:08:50.000+0000 Last Updated: 2009-07-03T07:16:51.000+0000 Status: Resolved Fix version(s): Reporter: Florent PELLET (f.pellet) Assignee: Dolf Schimmel (Freeaqingme) (freak) Tags: - Zend_Date

Related issues: - ZF-7185



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:

<pre class="highlight">
    protected function getUnixTimestamp()
        if($this->_unixTimestamp === null) return null;

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


Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-07-03T07:16:45.000+0000

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.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.