hhvm
hhvm copied to clipboard
Zend Incompatability: DateTime comparison
Comparison operators with DateTime object don't seem to work the same as they do in Zend.
Test Case:
<?php
$d1 = new DateTime('Tue, 13 Aug 2013 13:24:00 +0000');
$d2 = new DateTime('Wed, 14 Aug 2013 13:24:00 +0000');
var_dump($d2 > $d1);
var_dump($d2 < $d1);
ZendPHP output:
$ php test.php
bool(true)
bool(false)
HHVM Output:
$ hhvm test.php
bool(false)
bool(false)
Thanks for reporting this. Feel free to submit a PR if you (or anyone else) get to this before we do.
For anyone else affected: $date->getTimestamp() is an easy way to work around this.
I think @ptarjan already has a fix for this one?
Yup, fixed by https://github.com/facebook/hhvm/commit/525d97518e1e0ef90c9e896eb0a280a50cb801b8