3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d1 = new \Datetime('2017-5-1'); $d2 = new \Datetime('2017-6-1'); $diff = $d1->diff($d2); echo sprintf('%d Month\\s', $diff->m) . PHP_EOL;

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
49.07 ms | 2310 KiB | 4 Q