3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Fake data $data = [ ['start' => '2022-11-03'], ['start' => '2022-11-04'], ['start' => date('Y-m-d')], ]; $now = new DateTime(); foreach($data as $records) { $start = new DateTime($records['start']); $diff = $start->diff(new DateTime()); // Convert days and hours to minutes, and sum them all up to get total // diff in minutes $minutes = ($diff->days * 24 * 60) + ($diff->h * 60) + ($diff->i); echo $start->format('Y-m-d H:i') . " was " . $minutes . " minutes ago\n"; }
Output for 8.1.12 - 8.1.33, 8.2.10 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
2022-11-03 00:00 was 3202 minutes ago 2022-11-04 00:00 was 1762 minutes ago 2022-11-05 00:00 was 322 minutes ago
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
102.07 ms | 407 KiB | 5 Q