According to the Carbon docs:
$first = Carbon::create(2012, 9, 5, 23, 26, 11);
$second = Carbon::create(2012, 9, 5, 20, 26, 11, 'America/Vancouver');
var_dump($first <= $second); // bool(true)
The latter comparison works!!! Why?
All I can find on the internet is
objects are compared by recursively comparing their properties in the order that they are defined, which includes public, protected, and private properties.
So I suspect the Carbon
instance has the datetime 2012-09-05 23:26:11
[*] as its first property and so it gets compared, but that raises so many questions and I can't "step into" the comparison with XDebug.
Has anyone a good explanation for this?
[*] Dates in ISO format can be compared in string form.