3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = new DateTime('2015-09-01'); $b = new DateTime('2015-09-20'); $fw = $a->diff($b); $bw = $b->diff($a); echo "{$fw->days}, {$fw->d}, {$fw->invert}\n"; echo "{$bw->days}, {$bw->d}, {$bw->invert}\n";
based on 34pJG
Output for 5.4.0 - 5.6.23, 5.6.25 - 7.2.0
19, 19, 0 19, 19, 1
Output for 5.6.24

Process exited with code 137.