3v4l.org

run code in 300+ PHP versions simultaneously
<?php function join_words($words) { $return = []; for ($i=0; $i < count($words); $i++) { $return[] = implode(' ', array_slice($words, 0, $i+1)); } return $return; } $words = ['THIS', 'IS', 'AN', 'EXAMPLE']; $result = []; $result = array_merge($result, array_reverse(join_words($words))); $result = array_merge($result, array_reverse(join_words(array_reverse($words)))); print_r($result);

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.00819.13
8.5.20.0070.01019.57
8.5.10.0130.00518.52
8.5.00.0100.01120.22
8.4.180.0130.00922.53
8.4.170.0120.01020.56
8.4.160.0130.00822.33
8.4.150.0080.00416.75
8.4.140.0120.00917.74
8.4.130.0140.00717.85
8.4.120.0110.00820.51
8.4.110.0110.01022.43
8.4.100.0040.00518.46
8.4.90.0040.00418.95
8.4.80.0140.00820.32
8.4.70.0130.01117.98
8.4.60.0090.00918.71
8.4.50.0110.00518.46
8.4.40.0140.00717.69
8.4.30.0100.01017.48
8.4.20.0170.00719.62
8.4.10.0130.00619.57
8.3.300.0140.00820.85
8.3.290.0140.00720.76
8.3.280.0150.00518.38
8.3.270.0120.00416.54
8.3.260.0050.00316.64
8.3.250.0140.00618.92
8.3.240.0100.00917.48
8.3.230.0100.00816.48
8.3.220.0090.00619.00
8.3.210.0050.00618.50
8.3.200.0040.00416.66
8.3.190.0120.00617.15
8.3.180.0080.00816.48
8.3.170.0090.00918.84
8.3.160.0140.00317.10
8.3.150.0120.00617.14
8.3.140.0040.01117.36
8.3.130.0050.00318.48
8.3.120.0060.00318.90
8.3.110.0040.00416.50
8.3.100.0030.00624.06
8.3.90.0080.00026.77
8.3.80.0030.00716.63
8.3.70.0040.01118.43
8.3.60.0130.00618.38
8.3.50.0090.00918.20
8.3.40.0000.01518.42
8.3.30.0120.00618.67
8.3.20.0000.00720.34
8.3.10.0060.00321.85
8.3.00.0050.00519.01
8.2.300.0130.00622.17
8.2.290.0030.00720.55
8.2.280.0090.01018.35
8.2.270.0090.00918.81
8.2.260.0040.00416.37
8.2.250.0090.00916.75
8.2.240.0030.00518.95
8.2.230.0060.00320.94
8.2.220.0140.00037.54
8.2.210.0040.00426.77
8.2.200.0040.00716.25
8.2.190.0120.00916.58
8.2.180.0110.00725.92
8.2.170.0140.00718.83
8.2.160.0070.01022.96
8.2.150.0070.00025.66
8.2.140.0050.00224.66
8.2.130.0040.00426.16
8.2.120.0040.00421.05
8.2.110.0110.01120.94
8.2.100.0130.00317.54
8.2.90.0000.01117.61
8.2.80.0000.00818.69
8.2.70.0080.00018.03
8.2.60.0080.00018.05
8.2.50.0000.00818.10
8.2.40.0030.00522.18
8.2.30.0040.00419.44
8.2.20.0040.00418.05
8.2.10.0000.00818.06
8.2.00.0030.00618.44
8.1.340.0100.01017.47
8.1.330.0100.00822.01
8.1.320.0110.00916.19
8.1.310.0000.00816.89
8.1.300.0070.01118.12
8.1.290.0030.00730.84
8.1.280.0070.01125.92
8.1.270.0140.00324.66
8.1.260.0080.00026.35
8.1.250.0110.00328.09
8.1.240.0060.00317.46
8.1.230.0070.00419.00
8.1.220.0000.00817.74
8.1.210.0090.00018.77
8.1.200.0040.00417.36
8.1.190.0040.00419.08
8.1.180.0080.00018.10
8.1.170.0000.00818.65
8.1.160.0030.00318.94
8.1.150.0000.00720.34
8.1.140.0000.00817.70
8.1.130.0000.00717.41
8.1.120.0030.00617.35
8.1.110.0030.00517.43
8.1.100.0080.00017.47
8.1.90.0120.00017.42
8.1.80.0080.00017.35
8.1.70.0000.00717.37
8.1.60.0060.00617.51
8.1.50.0000.00917.54
8.1.40.0000.00817.53
8.1.30.0000.00817.57
8.1.20.0030.00617.56
8.1.10.0040.00417.43
8.1.00.0050.00317.27
8.0.300.0000.00818.77
8.0.290.0040.00416.63
8.0.280.0000.00718.44
8.0.270.0000.00816.70
8.0.260.0080.00016.76
8.0.250.0030.00316.96
8.0.240.0070.00016.88
8.0.230.0050.00216.95
8.0.220.0030.00316.81
8.0.210.0040.00416.70
8.0.200.0030.00316.88
8.0.190.0040.00416.94
8.0.180.0040.00416.81
8.0.170.0040.00416.81
8.0.160.0040.00416.87
8.0.150.0060.00616.81
8.0.140.0000.00716.80
8.0.130.0000.00513.29
8.0.120.0040.00416.73
8.0.110.0040.00416.91
8.0.100.0030.00416.83
8.0.90.0050.00216.93
8.0.80.0110.00416.93
8.0.70.0070.00016.85
8.0.60.0000.00716.81
8.0.50.0030.00516.78
8.0.30.0080.01117.14
8.0.20.0090.01017.40
8.0.10.0070.00016.83
8.0.00.0060.01016.85
7.4.330.0020.00215.55
7.4.320.0000.00616.50
7.4.300.0030.00316.65
7.4.290.0000.00716.36
7.4.280.0070.00016.48
7.4.270.0000.00716.55
7.4.260.0060.00016.59
7.4.250.0030.00316.42
7.4.240.0000.00716.61
7.4.230.0070.00016.50
7.4.220.0080.00016.34
7.4.210.0090.00716.59
7.4.200.0030.00316.63
7.4.160.0100.00816.51
7.4.150.0170.00017.40
7.4.140.0120.00817.86
7.4.130.0050.01116.63
7.4.120.0080.01216.54
7.4.110.0090.00916.46
7.4.100.0230.00016.57
7.4.90.0140.00416.52
7.4.80.0120.01519.39
7.4.70.0030.01416.53
7.4.60.0090.01016.52
7.4.50.0100.00316.51
7.4.40.0070.01016.36
7.4.00.0060.01014.89
7.3.330.0000.00513.23
7.3.320.0060.00013.33
7.3.310.0000.00716.35
7.3.300.0000.00716.25
7.3.290.0040.00416.22
7.3.280.0080.00916.27
7.3.270.0030.01417.40
7.3.260.0090.00916.57
7.3.250.0150.00516.47
7.3.240.0090.00916.47
7.3.230.0130.00316.44
7.3.210.0030.01516.68
7.3.200.0120.00916.46
7.3.190.0030.01216.50
7.3.180.0100.00716.30
7.3.170.0050.01116.32
7.3.160.0040.01116.49
7.2.330.0180.00316.75
7.2.320.0170.00016.84
7.2.310.0070.01016.85
7.2.300.0060.01116.44
7.2.290.0090.00916.57
7.2.60.0090.00616.73
7.2.10.1460.00718.00
7.2.00.0170.00918.14
7.1.200.0080.00415.78
7.1.130.0250.01316.61
7.1.120.0100.01316.95
7.1.110.0190.01015.59
7.1.100.0200.00716.16
7.1.90.0270.01015.98
7.1.80.0260.01015.99
7.1.70.0320.00615.29
7.1.60.0400.01933.33
7.1.50.0390.01332.80
7.1.40.0320.01932.52
7.1.30.0410.01432.81
7.1.20.0310.01432.75
7.1.10.0310.00714.91
7.1.00.0270.00614.92

preferences:
39.91 ms | 1415 KiB | 5 Q