3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo mtx_api_minutes_to_hours_format(0), "\n"; echo mtx_api_minutes_to_hours_format(1), "\n"; echo mtx_api_minutes_to_hours_format(10), "\n"; echo mtx_api_minutes_to_hours_format(60), "\n"; echo mtx_api_minutes_to_hours_format(61), "\n"; echo mtx_api_minutes_to_hours_format(62), "\n"; echo mtx_api_minutes_to_hours_format(74), "\n"; echo mtx_api_minutes_to_hours_format(120), "\n"; echo mtx_api_minutes_to_hours_format(121), "\n"; function mtx_api_minutes_to_hours_format(int $minutes): string { if ($minutes < 60) { return mtx_api_format_plural($minutes, '@count minute', '@count minutes'); } if (!$remaining_minutes = $minutes % 60) { return mtx_api_format_plural(intdiv($minutes, 60), '@count hour', '@count hours'); } return format_string('!hours !minutes', [ '!hours' => mtx_api_format_plural(intdiv($minutes, 60), '@count hour', '@count hours'), '!minutes' => mtx_api_format_plural($remaining_minutes, '@count minute', '@count minutes'), ]); } function mtx_api_format_plural($count, $singular, $plural) { return $count == 1 ? "$count $singular" : "$count $plural"; } function format_string($string, array $args = array()) { return strtr($string, $args); }

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.00.0110.01020.04
8.4.150.0020.00014.05
8.4.140.0120.01017.40
8.4.130.0120.00717.65
8.4.120.0050.00424.24
8.4.110.0040.00422.39
8.4.100.0070.01017.93
8.4.90.0080.00920.54
8.4.80.0080.01118.97
8.4.70.0110.00818.85
8.4.60.0110.00820.57
8.4.50.0090.00718.67
8.4.40.0100.01017.37
8.4.30.0120.00920.34
8.4.20.0170.00319.59
8.4.10.0000.00919.55
8.3.280.0120.01018.57
8.3.270.0130.00816.57
8.3.260.0040.00516.50
8.3.250.0120.00518.84
8.3.240.0100.01016.72
8.3.230.0100.00916.54
8.3.220.0070.00118.99
8.3.210.0090.00616.71
8.3.200.0030.00716.49
8.3.190.0060.00817.25
8.3.180.0120.00622.65
8.3.170.0050.00217.19
8.3.160.0180.00016.38
8.3.150.0110.00716.48
8.3.140.0140.00416.67
8.3.130.0060.00318.34
8.3.120.0130.00720.55
8.3.110.0120.01216.48
8.3.100.0140.01016.41
8.3.90.0100.01016.50
8.3.80.0060.00616.50
8.3.70.0110.00016.50
8.3.60.0030.00716.25
8.3.50.0150.00316.50
8.3.40.0090.00917.13
8.3.30.0130.00317.23
8.3.20.0070.01117.38
8.3.10.0090.00917.25
8.3.00.0070.00717.13
8.2.290.0140.00518.53
8.2.280.0020.00620.26
8.2.270.0090.00916.64
8.2.260.0040.00416.89
8.2.250.0110.00718.68
8.2.240.0060.00317.07
8.2.230.0100.00715.78
8.2.220.0110.00516.25
8.2.210.0100.00716.60
8.2.200.0180.00016.21
8.2.190.0130.00316.13
8.2.180.0170.00016.30
8.2.170.0170.00617.47
8.2.160.0130.00717.21
8.2.150.0150.00417.25
8.2.140.0110.00817.25
8.2.130.0100.01016.75
8.2.120.0090.00917.50
8.2.110.0160.00017.38
8.2.100.0140.00517.00
8.2.90.0110.00817.38
8.2.80.0190.00017.47
8.2.70.0140.00617.25
8.2.60.0160.00417.24
8.2.50.0240.00017.38
8.2.40.0140.00317.00
8.2.30.0060.01117.38
8.2.20.0100.00717.59
8.2.10.0070.01117.00
8.2.00.0150.00617.50
8.1.330.0150.00418.13
8.1.320.0110.00916.28
8.1.310.0040.00416.32
8.1.300.0000.00918.48
8.1.290.0180.00015.88
8.1.280.0040.01116.24
8.1.270.0090.00917.29
8.1.260.0130.00816.98
8.1.250.0130.00716.88
8.1.240.0110.00716.63
8.1.230.0190.00017.11
8.1.220.0110.00617.13
8.1.210.0100.00717.23
8.1.200.0100.00717.10
8.1.190.0130.00217.22
8.1.180.0170.00316.88
8.1.170.0170.00317.25
8.1.160.0150.00417.22
8.1.150.0120.00616.75
8.1.140.0130.00417.00
8.1.130.0110.00717.13
8.1.120.0120.00616.97
8.1.110.0050.01416.75
8.1.100.0140.00317.10
8.1.90.0100.00717.13
8.1.80.0100.00717.23
8.1.70.0140.00516.88
8.1.60.0180.00317.22
8.1.50.0160.00416.88
8.1.40.0170.00017.00
8.1.30.0050.01517.13
8.1.20.0140.00317.25
8.1.10.0130.00816.88
8.1.00.0130.00816.75

preferences:
38.98 ms | 403 KiB | 5 Q