3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subject = <<<'STR' $array = ['bananna', 'cranberry', 'apple']; $fn = function ($a, $b) { if(strlen($a) > strlen($b)) { return 1; } return 0; }; usort($array, $fn); STR; $pattern = '%\'\w*\'%'; $replacement = 'Chocolate'; $newStory = preg_replace($pattern, $replacement, $subject); print($newStory);

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.3.130.0050.00516.68
8.3.120.0080.00018.65
8.3.110.0040.00420.94
8.3.100.0090.00018.43
8.3.90.0000.01326.77
8.3.80.0060.00318.55
8.3.70.0130.00616.88
8.3.60.0070.00718.40
8.3.50.0070.00916.54
8.3.40.0160.00018.85
8.3.30.0090.00618.96
8.3.20.0040.00420.73
8.3.10.0000.00820.25
8.3.00.0000.00721.90
8.2.250.0030.00516.93
8.2.240.0100.00516.83
8.2.230.0060.00322.58
8.2.220.0030.00624.06
8.2.210.0110.00426.77
8.2.200.0030.00616.88
8.2.190.0070.00716.58
8.2.180.0110.00325.92
8.2.170.0040.01122.96
8.2.160.0070.01120.18
8.2.150.0090.00024.18
8.2.140.0090.00624.66
8.2.130.0110.00426.16
8.2.120.0070.00020.91
8.2.110.0060.00320.41
8.2.100.0130.00019.76
8.2.90.0000.00817.78
8.2.80.0040.00417.97
8.2.70.0000.00917.80
8.2.60.0000.00818.04
8.2.50.0000.00818.05
8.2.40.0030.00518.02
8.2.30.0050.00319.28
8.2.20.0070.00018.04
8.2.10.0000.00719.09
8.2.00.0040.00319.40
8.1.300.0090.00619.91
8.1.290.0040.00430.84
8.1.280.0070.01125.92
8.1.270.0090.00020.77
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0060.00322.25
8.1.230.0080.00420.84
8.1.220.0000.00817.79
8.1.210.0000.00918.77
8.1.200.0050.00517.47
8.1.190.0030.00617.22
8.1.180.0040.00418.10
8.1.170.0050.00217.62
8.1.160.0000.00718.86
8.1.150.0060.00318.72
8.1.140.0050.00318.84
8.1.130.0070.00017.52
8.1.120.0050.00317.58
8.1.110.0000.00817.56
8.1.100.0030.00317.43
8.1.90.0000.00817.55
8.1.80.0040.00417.61
8.1.70.0040.00417.43
8.1.60.0040.00417.73
8.1.50.0000.00817.43
8.1.40.0000.00817.57
8.1.30.0000.00817.76
8.1.20.0000.00917.72
8.1.10.0060.00317.64
8.1.00.0040.00417.61
8.0.300.0000.00819.77
8.0.290.0050.00316.75
8.0.280.0040.00418.48
8.0.270.0000.00717.29
8.0.260.0070.00017.09
8.0.250.0050.00217.14
8.0.240.0040.00417.14
8.0.230.0070.00016.99
8.0.220.0030.00616.90
8.0.210.0040.00416.97
8.0.200.0030.00317.00
8.0.190.0040.00417.01
8.0.180.0040.00416.97
8.0.170.0030.00517.00
8.0.160.0040.00417.13
8.0.150.0110.00017.02
8.0.140.0030.00317.01
8.0.130.0030.00313.44
8.0.120.0060.00316.83
8.0.110.0040.00416.83
8.0.100.0050.00317.07
8.0.90.0030.00517.05
8.0.80.0100.00717.00
8.0.70.0040.00416.82
8.0.60.0000.00716.90
8.0.50.0000.00716.90
8.0.30.0090.00917.12
8.0.20.0160.00317.14
8.0.10.0040.00417.04
8.0.00.0110.00616.75
7.4.330.0000.00415.55
7.4.320.0030.00316.74
7.4.300.0030.00316.70
7.4.290.0060.00316.62
7.4.280.0040.00416.54
7.4.270.0070.00016.70
7.4.260.0000.00716.59
7.4.250.0030.00316.66
7.4.240.0050.00216.66
7.4.230.0040.00416.56
7.4.220.0040.00416.68
7.4.210.0090.00716.68
7.4.200.0040.00416.50
7.4.160.0120.00716.69
7.4.140.0070.01017.86
7.4.130.0090.00916.80
7.4.120.0140.00416.75
7.4.110.0100.00616.74
7.4.100.0130.00316.79
7.4.90.0100.01016.72
7.4.80.0130.01019.39
7.4.70.0060.01016.61
7.4.60.0100.00716.63
7.4.50.0030.01316.65
7.4.40.0080.01216.73
7.4.00.0040.01215.22
7.3.330.0000.00613.16
7.3.320.0050.00013.19
7.3.310.0050.00216.48
7.3.300.0000.00716.39
7.3.290.0000.00716.41
7.3.280.0060.01516.42
7.3.260.0090.00816.52
7.3.240.0110.00716.50
7.3.230.0100.01016.43
7.3.210.0090.01516.48
7.3.200.0060.01116.56
7.3.190.0110.00416.38
7.3.180.0090.00916.43
7.3.170.0140.00316.42
7.3.160.0100.00716.41
7.3.50.0090.00914.81
7.3.40.0050.00614.65
7.3.30.0130.00714.83
7.3.20.0180.00514.91
7.3.10.0080.00714.83
7.3.00.0100.00514.90
7.2.330.0150.00916.80
7.2.320.0060.01316.63
7.2.310.0100.01016.75
7.2.300.0090.01116.79
7.2.290.0030.01416.59
7.2.180.0110.00815.04
7.2.170.0050.00715.11
7.2.160.0110.01214.99
7.2.150.0150.01215.11
7.2.140.0100.00915.15
7.2.130.0110.00815.20
7.2.120.0070.00715.30
7.2.110.0160.00615.21
7.2.100.0100.00715.18
7.2.90.0150.00815.18
7.2.80.0170.00915.20
7.2.70.0570.00615.25
7.2.60.0120.01215.26
7.2.50.0120.00914.89
7.2.40.0150.00915.31
7.2.30.0090.01415.34
7.2.20.0080.01115.18
7.2.10.0090.00714.96
7.2.00.0050.01015.31
7.1.280.0090.00614.00
7.1.270.0170.00814.13
7.1.260.0160.00313.93
7.1.250.0110.00814.19

preferences:
27.53 ms | 403 KiB | 5 Q