3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array2CSV(array $array) { $sanitized = array(); foreach ($array as $col) { $quote = false; if (preg_match('/[ \n\r\\\"]/')) { $quote = true; } $col = str_replace(array('\\', '"', "\n", "\r"), array('\/', '\"', '\n', '\r'), $col); if ($quote) { $col = "\"$col\""; } $sanitized[] = $col; } return implode(',', $sanitized); } echo array2CSV(array('test', 'te"t\est'));

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.0000.01416.63
8.3.50.0230.00516.34
8.3.40.0120.00318.79
8.3.30.0070.01018.79
8.3.20.0040.00418.77
8.3.10.0040.00418.83
8.3.00.0030.00619.38
8.2.180.0120.00316.50
8.2.170.0140.00022.96
8.2.160.0100.00718.96
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00420.89
8.2.110.0090.00019.39
8.2.100.0060.00617.97
8.2.90.0000.00919.22
8.2.80.0000.00817.97
8.2.70.0060.00317.63
8.2.60.0060.00317.93
8.2.50.0000.00717.93
8.2.40.0080.00019.35
8.2.30.0000.00817.72
8.2.20.0000.00917.65
8.2.10.0040.00417.73
8.2.00.0040.00417.82
8.1.280.0110.00425.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0080.00421.71
8.1.230.0100.00320.89
8.1.220.0050.00317.74
8.1.210.0050.00319.03
8.1.200.0060.00317.48
8.1.190.0040.00417.35
8.1.180.0060.00318.10
8.1.170.0040.00417.62
8.1.160.0070.00018.95
8.1.150.0040.00418.63
8.1.140.0040.00417.37
8.1.130.0080.00019.30
8.1.120.0080.00017.52
8.1.110.0040.00417.32
8.1.100.0060.00317.34
8.1.90.0040.00417.45
8.1.80.0070.00017.42
8.1.70.0070.00017.29
8.1.60.0040.00417.56
8.1.50.0040.00417.58
8.1.40.0040.00417.48
8.1.30.0050.00317.46
8.1.20.0000.00717.63
8.1.10.0000.01017.47
8.1.00.0000.00817.43
8.0.300.0050.00219.92
8.0.290.0000.00816.75
8.0.280.0030.00318.56
8.0.270.0030.00317.15
8.0.260.0000.00716.88
8.0.250.0030.00616.97
8.0.240.0100.00017.02
8.0.230.0040.00416.96
8.0.220.0000.00716.89
8.0.210.0030.00316.93
8.0.200.0040.00417.02
8.0.190.0000.00717.00
8.0.180.0040.00416.88
8.0.170.0060.00317.04
8.0.160.0000.00716.94
8.0.150.0000.00716.89
8.0.140.0000.00816.79
8.0.130.0060.00013.26
8.0.120.0050.00316.80
8.0.110.0000.00717.06
8.0.100.0050.00316.92
8.0.90.0040.00416.95
8.0.80.0070.00716.90
8.0.70.0040.00416.91
8.0.60.0080.00016.81
8.0.50.0030.00616.81
8.0.30.0160.00017.10
8.0.20.0140.00517.15
8.0.10.0040.00417.01
8.0.00.0100.01016.71
7.4.330.0000.00512.99
7.4.320.0030.00616.57
7.4.300.0030.00316.61
7.4.290.0000.00716.48
7.4.280.0030.00516.63
7.4.270.0040.00416.60
7.4.260.0000.00513.31
7.4.250.0100.00016.64
7.4.240.0030.00316.64
7.4.230.0070.00016.30
7.4.220.0080.01216.64
7.4.210.0030.01316.59
7.4.200.0040.00416.48
7.4.190.0070.00016.75
7.4.160.0130.00316.51
7.4.150.0280.02216.60
7.4.140.0150.00417.86
7.4.130.0060.01916.68
7.4.120.0100.00616.49
7.4.110.0100.01316.64
7.4.100.0160.00416.49
7.4.90.0070.01616.56
7.4.80.0080.00816.50
7.4.70.0090.00916.43
7.4.60.0130.00316.50
7.4.50.0000.00416.52
7.4.40.0070.00716.42
7.4.30.0120.00316.41
7.4.00.0030.01314.91
7.3.330.0050.00213.37
7.3.320.0030.00313.25
7.3.310.0000.00716.36
7.3.300.0070.00016.31
7.3.290.0010.01416.37
7.3.280.0060.00916.36
7.3.270.0130.00816.55
7.3.260.0120.01216.57
7.3.240.0100.01416.36
7.3.230.0100.01316.61
7.3.210.0130.00316.45
7.3.200.0100.00716.35
7.3.190.0060.01016.65
7.3.180.0110.01416.33
7.3.170.0060.01216.41
7.3.160.0110.00516.43
7.3.120.0080.00914.84
7.2.330.0030.01716.41
7.2.320.0070.01016.78
7.2.310.0110.00716.82
7.2.300.0100.01016.83
7.2.290.0100.00716.73
7.1.200.0040.00815.72
7.1.100.0000.00818.22
7.1.70.0060.00317.08
7.1.60.0110.01419.25
7.1.50.0120.00916.81
7.1.00.0000.03722.36
7.0.200.0030.00516.61
7.0.140.0030.07022.07
7.0.120.0030.07322.02
7.0.60.0000.08719.83
7.0.50.0030.04717.82
7.0.40.0030.04320.14
7.0.30.0270.08020.34
7.0.20.0330.07320.23
7.0.10.0200.08320.08
7.0.00.0100.06720.11
5.6.280.0000.07720.86
5.6.210.0100.03720.55
5.6.200.0030.04018.16
5.6.190.0030.09020.64
5.6.180.0230.08320.65
5.6.170.0230.06320.52
5.6.160.0030.05320.46
5.6.150.0100.07318.19
5.6.140.0030.07718.14
5.6.130.0170.07718.13
5.6.120.0030.08721.13
5.6.110.0030.07021.05
5.6.100.0030.09021.01
5.6.90.0100.07021.00
5.6.80.0070.08320.34
5.6.70.4270.03320.37
5.5.350.0130.05320.41
5.5.340.0070.08017.95
5.5.330.0170.07720.32
5.5.320.0500.07020.28
5.5.310.0300.08320.27
5.5.300.0170.05317.98
5.5.290.0100.08317.95
5.5.280.0100.07720.80
5.5.270.0070.04320.89
5.5.260.0030.04320.83
5.5.250.0100.08320.59
5.5.240.0070.05320.38
5.4.450.0300.05319.31
5.4.440.0300.05719.55
5.4.430.0300.05319.54
5.4.420.0370.05319.56
5.4.410.0230.06319.07
5.4.400.0270.03719.11
5.4.390.0230.04319.15
5.4.380.0230.07719.09
5.4.370.0270.05318.84
5.4.360.0230.04719.07
5.4.350.0200.03319.07
5.4.340.0170.03319.13
5.4.320.0200.05719.16
5.4.310.0200.03319.20
5.4.300.0130.05018.87
5.4.290.0130.03719.16
5.4.280.0170.04019.13
5.4.270.0170.03319.18
5.4.260.0200.03719.08
5.4.250.0130.03719.23
5.4.240.0100.04019.19
5.4.230.0200.05019.22
5.4.220.0130.03719.23
5.4.210.0200.04318.94
5.4.200.0130.04019.16
5.4.190.0130.04019.14
5.4.180.0170.03318.97
5.4.170.0130.04019.15
5.4.160.0130.03719.05
5.4.150.0130.04319.07
5.4.140.0200.03716.33
5.4.130.0130.05716.51
5.4.120.0300.06316.55
5.4.110.0230.05316.58
5.4.100.0270.07016.55
5.4.90.0230.05716.56
5.4.80.0270.07016.39
5.4.70.0300.06316.50
5.4.60.0230.07016.39
5.4.50.0230.05716.34
5.4.40.0200.07016.48
5.4.30.0270.06716.21
5.4.20.0170.07316.55
5.4.10.0230.06016.51
5.4.00.0270.06015.86
5.3.290.0200.03314.59
5.3.280.0300.05014.49
5.3.270.0170.03714.68
5.3.260.0100.04014.62
5.3.250.0170.03714.61
5.3.240.0100.04014.64
5.3.230.0230.03714.51
5.3.220.0230.06314.79
5.3.210.0470.06014.54
5.3.200.0270.07014.68
5.3.190.0230.07014.46
5.3.180.0270.05714.53
5.3.170.0270.06714.58
5.3.160.0200.06714.65
5.3.150.0230.06714.53
5.3.140.0300.04314.60
5.3.130.0230.04714.55
5.3.120.0200.06714.47
5.3.110.0270.05014.46
5.3.100.0170.05313.96
5.3.90.0200.04714.02
5.3.80.0170.05714.25
5.3.70.0200.07313.94
5.3.60.0230.03713.90
5.3.50.0200.03714.03
5.3.40.0170.05313.86
5.3.30.0200.06313.91
5.3.20.0200.07313.91
5.3.10.0270.06713.57
5.3.00.0200.04713.80
5.2.170.0270.03312.40
5.2.160.0170.03712.40
5.2.150.0230.04012.40
5.2.140.0130.03312.40
5.2.130.0170.05012.40
5.2.120.0170.02712.40
5.2.110.0230.05712.40
5.2.100.0230.05312.40
5.2.90.0200.05712.40
5.2.80.0170.04312.40
5.2.70.0230.02712.40
5.2.60.0270.05712.40
5.2.50.0170.05012.40
5.2.40.0170.04712.40
5.2.30.0100.04712.40
5.2.20.0170.05312.40
5.2.10.0200.05312.40
5.2.00.0170.05712.40
5.1.60.0170.04312.40
5.1.50.0030.05012.40
5.1.40.0170.05312.40
5.1.30.0200.03712.40
5.1.20.0170.04012.40
5.1.10.0100.03312.40
5.1.00.0200.02312.40
5.0.50.0030.02712.40
5.0.40.0070.03012.40
5.0.30.0070.04012.40
5.0.20.0070.03312.40
5.0.10.0100.03712.40
5.0.00.0070.06012.40
4.4.90.0030.04012.40
4.4.80.0070.03312.40
4.4.70.0100.03012.40
4.4.60.0100.03312.40
4.4.50.0070.03712.40
4.4.40.0100.04312.40
4.4.30.0070.04012.40
4.4.20.0070.02312.40
4.4.10.0100.03712.40
4.4.00.0130.05012.40
4.3.110.0030.02712.40
4.3.100.0070.03012.40
4.3.90.0070.02012.40
4.3.80.0100.04012.40
4.3.70.0100.03012.40
4.3.60.0070.03312.40
4.3.50.0100.02312.40
4.3.40.0070.04712.40
4.3.30.0100.03012.40
4.3.20.0030.02712.40
4.3.10.0030.02312.40
4.3.00.0030.03712.40

preferences:
45.91 ms | 401 KiB | 5 Q