3v4l.org

run code in 500+ PHP versions simultaneously
<?php function method_a(&$links, ?bool $indexable) { $links[] = [ 'indexable === ' => as_string($indexable), // very long list... and: ...(null !== $indexable ? ['indexable' => $indexable] : []), ]; } function method_b(&$links, ?bool $indexable) { $link = [ 'indexable === ' => as_string($indexable), // very long list... and: ]; if (null !== $indexable) { $link['indexable'] = $indexable; } $links[] = $link; } function as_string($v) { if (null === $v) { return 'null'; } if (false === $v) { return 'false'; } if (true === $v) { return 'true'; } } $links = []; method_a($links, null); method_a($links, true); method_a($links, false); var_dump($links); $links = []; method_b($links, null); method_b($links, true); method_b($links, false); var_dump($links);

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.0120.00619.55
8.5.20.0060.00119.97
8.5.10.0110.00716.85
8.5.00.0130.00920.07
8.4.180.0070.00323.89
8.4.170.0130.01020.41
8.4.160.0100.01123.70
8.4.150.0090.00316.88
8.4.140.0150.01217.73
8.4.130.0120.00918.70
8.4.120.0100.01024.09
8.4.110.0100.01018.88
8.4.100.0110.00918.67
8.4.90.0140.00622.13
8.4.80.0060.00420.44
8.4.70.0150.00518.07
8.4.60.0080.00318.97
8.4.50.0120.00818.64
8.4.40.0100.01017.55
8.4.30.0130.00320.53
8.4.20.0140.00717.82
8.4.10.0030.00619.55
8.3.300.0080.01220.79
8.3.290.0170.00420.84
8.3.280.0220.00618.34
8.3.270.0130.00816.77
8.3.260.0120.00816.75
8.3.250.0150.00419.05
8.3.240.0090.00917.10
8.3.230.0090.01216.60
8.3.220.0110.00718.76
8.3.210.0090.01116.61
8.3.200.0080.00116.66
8.3.190.0100.00718.96
8.3.180.0090.00717.04
8.3.170.0120.00618.92
8.3.160.0080.00016.66
8.3.150.0100.01017.16
8.3.140.0030.00716.68
8.3.130.0040.00416.91
8.3.120.0120.00320.70
8.3.110.0080.00020.94
8.3.100.0090.00016.53
8.3.90.0000.00826.77
8.3.80.0030.00618.18
8.3.70.0120.00316.50
8.3.60.0060.01316.50
8.3.50.0120.00318.28
8.3.40.0130.00320.29
8.3.30.0070.00721.94
8.3.20.0050.00224.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.300.0130.00922.18
8.2.290.0130.00520.30
8.2.280.0140.00618.56
8.2.270.0120.00617.24
8.2.260.0080.00816.48
8.2.250.0000.00916.91
8.2.240.0030.00619.05
8.2.230.0110.00422.58
8.2.220.0060.00324.06
8.2.210.0030.00626.77
8.2.200.0060.00318.29
8.2.190.0040.01118.54
8.2.180.0040.01816.63
8.2.170.0110.00318.79
8.2.160.0070.00722.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0070.00319.54
8.2.110.0100.00820.40
8.2.100.0090.00918.93
8.2.90.0150.00518.87
8.2.80.0140.00518.66
8.2.70.0120.00718.81
8.2.60.0150.00818.73
8.2.50.0120.00919.08
8.2.40.0130.00919.08
8.2.30.0080.01018.80
8.2.20.0080.00919.02
8.2.10.0150.00419.14
8.2.00.0150.00419.08
8.1.340.0160.00521.84
8.1.330.0130.00821.90
8.1.320.0150.00518.09
8.1.310.0040.00416.19
8.1.300.0030.00518.47
8.1.290.0050.00530.84
8.1.280.0110.00725.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0150.00418.49
8.1.230.0110.00718.44
8.1.220.0120.00818.53
8.1.210.0090.00719.80
8.1.200.0130.00618.54
8.1.190.0110.00418.48
8.1.180.0100.00618.83
8.1.170.0090.00818.58
8.1.160.0120.00518.61
8.1.150.0060.00720.57
8.1.140.0110.00618.46
8.1.130.0120.00618.52
8.1.120.0100.00618.56
8.1.110.0110.00518.59
8.1.100.0110.00718.51
8.1.90.0080.00518.40
8.1.80.0060.00418.45
8.1.70.0070.00418.71
8.1.60.0120.00318.66
8.1.50.0110.00318.61
8.1.40.0110.00618.84
8.1.30.0150.00518.87
8.1.20.0110.00418.76
8.1.10.0070.00718.63
8.1.00.0080.00818.71
8.0.300.0130.00417.89
8.0.290.0110.00517.84
8.0.280.0080.00617.91
8.0.270.0090.00817.87
8.0.260.0090.00417.86
8.0.250.0110.00517.90
8.0.240.0090.00617.92
8.0.230.0080.00518.35
8.0.220.0100.00717.88
8.0.210.0110.00717.95
8.0.200.0120.00517.91
8.0.190.0110.00517.93
8.0.180.0090.00917.98
8.0.170.0100.00517.93
8.0.160.0100.00417.92
8.0.150.0160.00417.85
8.0.140.0110.00717.87
8.0.130.0070.00717.84
8.0.120.0100.00717.85
8.0.110.0120.00317.95
8.0.100.0090.00717.84
8.0.90.0090.00417.91
8.0.80.0100.00517.84
8.0.70.0100.00517.88
8.0.60.0130.00417.91
8.0.50.0120.00417.88
8.0.30.0100.00617.91
8.0.20.0080.00617.97
8.0.10.0080.00618.04

preferences:
92.32 ms | 1175 KiB | 5 Q