3v4l.org

run code in 300+ PHP versions simultaneously
<?php function serializeContext($default, $optional) { return "'" . implode("', '", array_merge( $default, $optional )) . "'" ; } $a = array('test1', 'test2', 'test3'); $b = array('test4'); var_dump(serializeContext($a, $b)); // echo array_reduce($a, // function($carry, $next){ // return $carry . $next; // }, ''); // var_dump(array_reduce($a, function($carry, $next){ // return $carry .= " $next"; // })); var_dump(serializeContext(explode(' ', array_reduce($a, function($carry, $next){ return $carry .= " $next"; }, 'IN')), $b));

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.60.0040.01118.43
8.3.50.0140.00521.13
8.3.40.0080.00618.84
8.3.30.0080.00619.23
8.3.20.0000.00720.34
8.3.10.0000.00721.69
8.3.00.0040.00418.80
8.2.180.0140.00718.41
8.2.170.0170.00022.96
8.2.160.0070.00720.24
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0000.00821.07
8.2.110.0000.00920.94
8.2.100.0090.00317.75
8.2.90.0000.00819.35
8.2.80.0080.00017.97
8.2.70.0040.00417.75
8.2.60.0030.00617.80
8.2.50.0080.00018.07
8.2.40.0040.00418.09
8.2.30.0000.00718.19
8.2.20.0050.00217.80
8.2.10.0040.00418.19
8.2.00.0050.00318.13
8.1.280.0180.00325.92
8.1.270.0070.00720.25
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0050.00522.72
8.1.230.0090.00317.48
8.1.220.0000.00817.74
8.1.210.0030.00518.77
8.1.200.0000.00917.22
8.1.190.0060.00317.35
8.1.180.0050.00318.10
8.1.170.0030.00618.39
8.1.160.0000.00721.94
8.1.150.0050.00318.87
8.1.140.0070.00217.43
8.1.130.0000.00717.75
8.1.120.0000.00817.49
8.1.110.0000.00817.36
8.1.100.0050.00317.49
8.1.90.0000.00717.38
8.1.80.0050.00217.52
8.1.70.0000.00717.26
8.1.60.0040.00417.59
8.1.50.0060.00317.55
8.1.40.0030.00617.52
8.1.30.0000.00817.54
8.1.20.0030.00517.68
8.1.10.0040.00417.41
8.1.00.0040.00417.50
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0040.00418.40
8.0.270.0030.00316.73
8.0.260.0060.00017.16
8.0.250.0040.00416.81
8.0.240.0000.00816.98
8.0.230.0000.00716.95
8.0.220.0070.00016.85
8.0.210.0000.00716.88
8.0.200.0070.00016.99
8.0.190.0000.00716.90
8.0.180.0000.00816.84
8.0.170.0050.00316.87
8.0.160.0030.00316.88
8.0.150.0030.00416.88
8.0.140.0000.00716.74
8.0.130.0050.00013.32
8.0.120.0090.00016.83
8.0.110.0060.00316.90
8.0.100.0080.00017.00
8.0.90.0050.00216.76
8.0.80.0060.01016.95
8.0.70.0000.00716.77
8.0.60.0000.00816.96
8.0.50.0030.00516.93
8.0.30.0110.00816.94
8.0.20.0150.00517.40
8.0.10.0000.00716.88
8.0.00.0080.00916.79
7.4.330.0020.00215.14
7.4.320.0030.00316.60
7.4.300.0030.00316.59
7.4.290.0040.00416.43
7.4.280.0080.00016.61
7.4.270.0040.00416.47
7.4.260.0000.00716.63
7.4.250.0070.00016.54
7.4.240.0000.00716.52
7.4.230.0070.00016.36
7.4.220.0070.01016.66
7.4.210.0040.01116.71
7.4.200.0030.00316.64
7.4.160.0080.00816.47
7.4.150.0200.00017.40
7.4.140.0050.01517.86
7.4.130.0090.00916.49
7.4.120.0050.01416.41
7.4.110.0030.01616.38
7.4.100.0150.00516.41
7.4.90.0100.00716.42
7.4.80.0100.00719.39
7.4.70.0090.01216.50
7.4.60.0090.00616.44
7.4.50.0000.00416.46
7.4.40.0100.01016.36
7.4.30.0160.00916.59
7.4.00.0090.00914.71
7.3.330.0000.00513.30
7.3.320.0030.00313.00
7.3.310.0030.00516.15
7.3.300.0000.00716.34
7.3.290.0040.01016.30
7.3.280.0080.01116.28
7.3.270.0140.00817.40
7.3.260.0090.00916.33
7.3.250.0100.00916.49
7.3.240.0130.00916.42
7.3.230.0100.01016.55
7.3.210.0130.01416.43
7.3.200.0090.00919.39
7.3.190.0070.01016.51
7.3.180.0060.01216.15
7.3.170.0070.01016.54
7.3.160.0090.00716.33
7.3.120.0070.00714.83
7.3.110.0100.00614.53
7.3.100.0090.00315.07
7.3.90.0120.00314.67
7.3.80.0080.00814.81
7.3.70.0140.00314.84
7.3.60.0000.01414.87
7.3.50.0030.01014.79
7.3.40.0100.00714.71
7.3.30.0040.00714.93
7.3.20.0080.00316.57
7.3.10.0030.01116.66
7.3.00.0080.00916.71
7.2.330.0090.01316.73
7.2.320.0130.01016.71
7.2.310.0030.01316.71
7.2.300.0130.00416.65
7.2.290.0150.00416.73
7.2.240.0000.01514.87
7.2.230.0070.01115.19
7.2.220.0090.00614.89
7.2.210.0040.01115.11
7.2.200.0110.01115.03
7.2.190.0100.00614.98
7.2.180.0090.00614.92
7.2.170.0100.00314.96
7.2.160.0060.00915.03
7.2.150.0120.00316.66
7.2.140.0030.01216.60
7.2.130.0110.00316.73
7.2.120.0070.00816.80
7.2.110.0090.00616.93
7.2.100.0060.00816.86
7.2.90.0070.01016.74
7.2.80.0100.00316.84
7.2.70.0060.00516.94
7.2.60.0070.00916.87
7.2.50.0050.01016.92
7.2.40.0040.00616.77
7.2.30.0050.01016.74
7.2.20.0030.01316.78
7.2.10.0050.00816.88
7.2.00.0030.01217.69
7.1.330.0030.00915.86
7.1.320.0040.01115.64
7.1.310.0070.01015.67
7.1.300.0030.01115.96
7.1.290.0070.01015.61
7.1.280.0040.01115.95
7.1.270.0060.00915.78
7.1.260.0060.01015.80
7.1.250.0090.00515.73
7.1.100.0070.00418.48
7.1.70.0090.00017.09
7.1.60.0140.00719.48
7.1.50.0070.01417.03
7.1.00.0000.07722.53
7.0.200.0000.00716.44
7.0.60.0200.07021.63
7.0.50.0030.04317.89
7.0.40.0070.07320.14
7.0.30.0270.08020.10
7.0.20.0330.07720.33
7.0.10.0130.07320.05
7.0.00.0030.04020.11
5.6.280.0100.06321.13
5.6.210.0100.07720.66
5.6.200.0070.04018.21
5.6.190.0130.08020.41
5.6.180.3200.04320.33
5.6.170.0170.05320.57
5.6.160.0000.05020.44
5.6.150.0070.03718.19
5.6.140.0030.07018.11
5.6.130.0100.05718.24
5.6.120.0000.09320.97
5.6.110.0100.08321.14
5.6.100.0130.04721.13
5.6.90.0100.08721.11
5.6.80.0070.04720.40
5.5.350.4130.04320.46
5.5.340.0030.04017.99
5.5.330.0030.04020.41
5.5.320.0200.04720.30
5.5.310.0270.04020.19
5.5.300.0070.08018.09
5.5.290.0100.07717.95
5.5.280.0070.03720.99
5.5.270.0130.07720.77
5.5.260.0030.07020.68
5.5.250.0070.08320.67
5.5.240.0230.08020.17
5.4.450.0430.05019.30
5.4.440.0270.05019.64
5.4.430.0400.07719.16
5.4.420.0400.05019.52
5.4.410.0370.06319.18
5.4.400.0470.06719.23
5.4.390.0570.03319.23
5.4.380.0530.03019.31
5.4.370.0330.04019.16
5.4.360.0470.06719.12
5.4.350.0430.03319.21
5.4.340.0330.03718.98
5.4.320.0500.04719.05
5.4.310.0330.04019.00
5.4.300.0370.03718.99
5.4.290.0400.03319.11
5.4.280.0300.04719.20
5.4.270.0530.05318.87
5.4.260.0270.04718.88
5.4.250.0370.03319.30
5.4.240.0370.03718.99
5.4.230.0600.05019.04
5.4.220.0470.06719.04
5.4.210.0270.04319.16
5.4.200.0300.04018.99
5.4.190.0270.04019.19
5.4.180.0500.06019.19
5.4.170.0300.04319.04
5.4.160.0370.04718.98
5.4.150.0400.03319.21
5.4.140.0300.04016.30
5.4.130.0300.04716.39
5.4.120.0370.06716.34
5.4.110.0470.06016.39
5.4.100.0430.07316.56
5.4.90.0430.05716.29
5.4.80.0430.06716.43
5.4.70.0430.07016.54
5.4.60.0470.05016.53
5.4.50.0300.05016.55
5.4.40.0330.03716.49
5.4.30.0470.06316.23
5.4.20.0470.06316.53
5.4.10.0430.06716.48
5.4.00.0300.04015.79
5.3.290.0430.03314.59
5.3.280.0330.04714.75
5.3.270.0400.07314.70
5.3.260.0370.04014.61
5.3.250.0370.04714.73
5.3.240.0430.06314.52
5.3.230.0430.03714.61
5.3.220.0430.03014.55
5.3.210.0430.04314.66
5.3.200.0430.06314.58
5.3.190.0470.06014.69
5.3.180.0300.04014.69
5.3.170.0330.04014.58
5.3.160.0400.05014.72
5.3.150.0300.04014.68
5.3.140.0230.04314.54
5.3.130.0430.06014.57
5.3.120.0400.04714.61
5.3.110.0500.03314.50
5.3.100.0400.06714.12
5.3.90.0630.02314.17
5.3.80.0470.05313.93
5.3.70.0470.06013.93
5.3.60.0370.07013.93
5.3.50.0370.03714.07
5.3.40.0430.03714.03
5.3.30.0500.05313.83
5.3.20.0500.05713.60
5.3.10.0500.06313.66
5.3.00.0330.04013.70
5.2.170.0330.03712.24
5.2.160.0300.06012.24
5.2.150.0300.05012.24
5.2.140.0330.05712.24
5.2.130.0370.03712.24
5.2.120.0430.04712.24
5.2.110.0330.04712.24
5.2.100.0400.05012.24
5.2.90.0270.03312.24
5.2.80.0400.04312.24
5.2.70.0330.04012.24
5.2.60.0400.04712.24
5.2.50.0300.06012.24
5.2.40.0300.02312.24
5.2.30.0270.04312.24
5.2.20.0300.05312.24
5.2.10.0270.03312.24
5.2.00.0230.02712.24
5.1.60.0200.02712.24
5.1.50.0370.02712.24
5.1.40.0270.02712.24
5.1.30.0300.04012.24
5.1.20.0200.02312.24
5.1.10.0200.02312.24
5.1.00.0130.03012.24
5.0.50.0100.02312.24
5.0.40.0130.01712.24
5.0.30.0130.02712.24
5.0.20.0070.02012.24
5.0.10.0100.02012.24
5.0.00.0100.03012.24
4.4.90.0070.01712.24
4.4.80.0070.01712.24
4.4.70.0070.01712.24
4.4.60.0070.01712.24
4.4.50.0130.01712.24
4.4.40.0100.02712.24
4.4.30.0070.01712.24
4.4.20.0130.01312.24
4.4.10.0070.01712.24
4.4.00.0100.02312.24
4.3.110.0100.01712.24
4.3.100.0070.01712.24
4.3.90.0070.01712.24
4.3.80.0100.02712.24
4.3.70.0100.01312.24
4.3.60.0070.01712.24
4.3.50.0100.01712.24
4.3.40.0100.02712.24
4.3.30.0070.01712.24
4.3.20.0070.01312.24
4.3.10.0070.01312.24
4.3.00.0030.01712.24

preferences:
59.25 ms | 401 KiB | 5 Q