3v4l.org

run code in 500+ PHP versions simultaneously
<?php $date = '10.11.2021 14:00'; $diff = (new DateTime($date))->diff(new DateTime()); $lookup = [ 'y' => 'year', 'm' => 'month', 'd' => 'day', 'h' => 'hour', 'i' => 'minute', ]; $output = 'mere seconds'; foreach ($lookup as $property => $word) { if ($amt = $diff->$property) { if ($property === 'd' && $diff->$property >= 7) { $amt = intdiv($diff->$property, 7); $word = 'week'; } $output = "$amt $word" . ($amt !== 1 ? 's' : ''); break; } } echo "for $output";

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.30.0290.00716.83
8.5.20.0340.00716.56
8.5.10.0350.00616.79
8.5.00.0340.00916.68
8.4.180.0130.01019.88
8.4.170.0340.00719.61
8.4.160.0300.01419.75
8.4.150.0360.00719.64
8.4.140.0340.00817.69
8.4.130.0340.00817.84
8.4.120.0350.00918.02
8.4.110.0380.00917.89
8.4.100.0410.00817.81
8.4.90.0260.00717.59
8.4.80.0160.00617.69
8.4.70.0170.00318.04
8.4.60.0160.00517.84
8.4.50.0170.00317.88
8.4.40.0190.00417.78
8.4.30.0190.00218.07
8.4.20.0350.00817.84
8.4.10.0200.00417.75
8.3.300.0230.00818.41
8.3.290.0230.00618.27
8.3.280.0180.00518.49
8.3.270.0220.00316.82
8.3.260.0160.00416.95
8.3.250.0310.01016.79
8.3.240.0320.00816.77
8.3.230.0320.00916.95
8.3.220.0400.00816.81
8.3.210.0280.00616.82
8.3.200.0250.00616.59
8.3.190.0210.00316.85
8.3.180.0340.00816.85
8.3.170.0360.00916.71
8.3.160.0390.00716.91
8.3.150.0400.00816.75
8.3.140.0260.00416.61
8.3.130.0280.00416.72
8.3.120.0160.00216.88
8.3.110.0120.00616.81
8.3.100.0140.00616.88
8.3.90.0250.00616.50
8.3.80.0330.00916.76
8.3.70.0340.00616.79
8.3.60.0320.00916.63
8.3.50.0360.00816.65
8.3.40.0370.01318.02
8.3.30.0300.01217.90
8.3.20.0300.01217.98
8.3.10.0260.00718.13
8.3.00.0170.01117.86

preferences:
45.4 ms | 699 KiB | 5 Q