3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_GET['sortBy'] = 'B'; function get_permalink() { return 'someurl'; } function get_terms($array) { return ['foo', 'bar', 'öle', 'can']; } function esc_html($string) { return htmlspecialchars($string, ENT_QUOTES); } function alpha_pagination() { $chars = array_fill_keys(range('A', 'Z'), false); foreach (get_terms(['taxonomy' => 'unknown', 'hide_empty' => true]) as $tax) { $chars[mb_strtoupper(mb_substr($tax, 0, 1))] = true; } ksort($chars); foreach ($chars as $char => $hasTerms) { $selected = ($_GET['sortBy'] ?? '_') === $char ? ' selected' : ''; if ($hasTerms) { printf( '<a class="button%s" href="%s?%s">%s</a>', $selected, get_permalink(), http_build_query(['sortby' => $char]), esc_html($char) ); } else { printf( '<span class="button disabled%s">%s</span>', $selected, esc_html($char) ); } echo "\n"; } } alpha_pagination();

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.10.0110.00716.57
8.5.00.0110.01119.80
8.4.160.0090.01323.74
8.4.150.0020.00114.05
8.4.140.0150.01117.47
8.4.130.0120.00718.59
8.4.120.0110.00823.97
8.4.110.0130.00922.36
8.4.100.0140.00818.71
8.4.90.0110.00818.87
8.4.80.0070.00218.77
8.4.70.0060.00317.86
8.4.60.0140.00818.89
8.4.50.0090.01118.68
8.4.40.0100.00617.75
8.4.30.0100.01019.07
8.4.20.0140.00717.68
8.4.10.0200.00019.25
8.3.290.0100.01120.71
8.3.280.0120.00818.50
8.3.270.0110.00916.55
8.3.260.0100.00716.50
8.3.250.0160.00319.07
8.3.240.0090.00817.05
8.3.230.0100.00916.93
8.3.220.0110.00718.93
8.3.210.0090.01018.50
8.3.200.0120.00616.86
8.3.190.0080.00118.93
8.3.180.0030.00520.82
8.3.170.0130.00620.54
8.3.160.0130.00618.21
8.3.150.0180.00017.34
8.3.140.0120.00617.40
8.3.130.0030.00518.50
8.3.120.0080.00018.94
8.3.110.0030.00620.94
8.3.100.0090.00324.06
8.3.90.0040.00426.77
8.3.80.0090.00019.36
8.3.70.0130.00316.38
8.3.60.0100.01016.59
8.3.50.0090.00616.60
8.3.40.0130.00721.61
8.3.30.0070.01522.96
8.3.20.0140.00723.64
8.3.10.0130.00723.71
8.3.00.0210.00022.96
8.2.300.0140.00622.16
8.2.290.0110.00920.39
8.2.280.0110.00918.38
8.2.270.0040.00717.35
8.2.260.0060.00316.50
8.2.250.0160.00319.22
8.2.240.0030.00618.20
8.2.230.0040.00422.58
8.2.220.0090.00037.54
8.2.210.0070.01126.77
8.2.200.0120.00018.88
8.2.190.0090.00918.29
8.2.180.0040.01116.75
8.2.170.0070.00722.96
8.2.160.0100.01022.96
8.2.150.0180.00322.96
8.2.140.0080.00822.96
8.2.130.0070.00722.96
8.2.120.0170.00322.96
8.2.110.0120.00622.96
8.2.100.0110.00422.96
8.2.90.0090.01222.96
8.2.80.0140.00622.96
8.2.70.0120.00922.96
8.2.60.0080.00822.96
8.2.50.0060.01022.96
8.2.40.0000.01522.96
8.2.30.0120.00322.96
8.2.20.0150.00422.96
8.2.10.0180.00022.96
8.2.00.0030.01322.96
8.1.340.0120.00719.76
8.1.330.0140.00522.05
8.1.320.0120.00721.72
8.1.310.0070.01118.39
8.1.300.0030.00618.13
8.1.290.0060.00330.84
8.1.280.0040.01125.92
8.1.270.0080.00623.85
8.1.260.0040.01123.89
8.1.250.0140.00023.82
8.1.240.0070.00722.96
8.1.230.0070.00722.96
8.1.220.0110.00322.96
8.1.210.0090.00622.96
8.1.200.0000.01622.96
8.1.190.0090.00622.96
8.1.180.0080.00822.96
8.1.170.0110.00422.96
8.1.160.0060.00922.96
8.1.150.0140.00722.96
8.1.140.0100.00722.96
8.1.130.0090.00622.96
8.1.120.0000.01522.96
8.1.110.0060.01022.96
8.1.100.0100.00622.96
8.1.90.0100.00722.96
8.1.80.0090.00922.96
8.1.70.0000.01522.96
8.1.60.0040.01122.96
8.1.50.0030.01322.96
8.1.40.0100.00722.96
8.1.30.0120.00322.96
8.1.20.0110.00722.96
8.1.10.0120.00322.96
8.1.00.0030.01322.96

preferences:
78.35 ms | 403 KiB | 5 Q