3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myArray = array( array( 1, 2, 3, 4, "a" ), array( 'a', "b", 'c', "d", 3 ), array( 'this is a quote " blah blah blah', "b", 'c', "d", 3 ) ); $csvOutput = ''; foreach($myArray as $key => $row) { $rowString = ''; foreach($row as $key => $col) { $rowString .= '"' . sanitize($col) . '", '; } $csvOutput .= rtrim($rowString, ', ') . "\n"; } echo $csvOutput; function sanitize($input) { return str_replace('"', '""', $input); }

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.0110.00718.20
8.3.50.0120.00722.04
8.3.40.0140.00718.75
8.3.30.0080.00619.04
8.3.20.0040.00420.35
8.3.10.0070.00022.09
8.3.00.0000.00822.39
8.2.180.0120.00316.63
8.2.170.0040.01422.96
8.2.160.0120.00320.89
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0120.00426.16
8.2.120.0110.00017.63
8.2.110.0000.00822.24
8.2.100.0090.00319.29
8.2.90.0030.00619.21
8.2.80.0030.00518.03
8.2.70.0050.00317.75
8.2.60.0080.00417.93
8.2.50.0000.00818.07
8.2.40.0050.00318.22
8.2.30.0020.00518.07
8.2.20.0000.00717.82
8.2.10.0040.00419.53
8.2.00.0040.00417.61
8.1.280.0130.00325.92
8.1.270.0040.00423.87
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0040.00423.92
8.1.230.0060.00619.05
8.1.220.0000.00817.77
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0040.00417.53
8.1.180.0050.00318.63
8.1.170.0030.00618.59
8.1.160.0000.00722.05
8.1.150.0000.00718.64
8.1.140.0020.00517.36
8.1.130.0040.00217.84
8.1.120.0000.00717.46
8.1.110.0000.00817.36
8.1.100.0070.00017.46
8.1.90.0030.00417.48
8.1.80.0070.00017.35
8.1.70.0030.00317.42
8.1.60.0030.00617.54
8.1.50.0000.00717.41
8.1.40.0050.00217.57
8.1.30.0030.00517.48
8.1.20.0040.00417.51
8.1.10.0040.00417.46
8.1.00.0040.00417.47
8.0.300.0040.00418.77
8.0.290.0050.00317.05
8.0.280.0070.00018.48
8.0.270.0000.00817.16
8.0.260.0030.00316.72
8.0.250.0000.00716.94
8.0.240.0040.00416.86
8.0.230.0000.01016.86
8.0.220.0070.00016.91
8.0.210.0040.00416.91
8.0.200.0040.00416.93
8.0.190.0000.00816.84
8.0.180.0070.00016.86
8.0.170.0030.00616.79
8.0.160.0040.00416.87
8.0.150.0000.00816.80
8.0.140.0070.00016.88
8.0.130.0030.00313.29
8.0.120.0070.00016.91
8.0.110.0070.00016.86
8.0.100.0070.00016.78
8.0.90.0000.00716.80
8.0.80.0030.01316.87
8.0.70.0070.00016.88
8.0.60.0000.00816.91
8.0.50.0030.00616.91
8.0.30.0110.01117.14
8.0.20.0110.00817.40
8.0.10.0070.00016.92
8.0.00.0110.01016.70
7.4.330.0050.00015.00
7.4.320.0000.00616.60
7.4.300.0030.00316.64
7.4.290.0060.00316.60
7.4.280.0030.00616.51
7.4.270.0030.00316.41
7.4.260.0070.00016.47
7.4.250.0030.00516.54
7.4.240.0050.00216.51
7.4.230.0000.00716.43
7.4.220.0070.01416.53
7.4.210.0090.00716.53
7.4.200.0000.00716.50
7.4.190.0000.00816.74
7.4.160.0030.01316.30
7.4.150.0100.00717.40
7.4.140.0070.01017.86
7.4.130.0100.00716.47
7.4.120.0050.01316.48
7.4.110.0070.01116.43
7.4.100.0110.00716.50
7.4.90.0060.01316.43
7.4.80.0070.01019.39
7.4.70.0120.00916.47
7.4.60.0040.01716.39
7.4.50.0020.00216.37
7.4.40.0100.00722.77
7.4.30.0070.01116.67
7.4.00.0090.00614.76
7.3.330.0000.00513.06
7.3.320.0000.00513.05
7.3.310.0070.00016.33
7.3.300.0030.00316.14
7.3.290.0120.00316.28
7.3.280.0110.00716.31
7.3.270.0100.00717.40
7.3.260.0180.00016.55
7.3.250.0080.00916.51
7.3.240.0030.01416.28
7.3.230.0170.00316.51
7.3.210.0150.00316.36
7.3.200.0030.01319.39
7.3.190.0210.00016.42
7.3.180.0000.01716.53
7.3.170.0190.00316.50
7.3.160.0140.00316.58
7.3.120.0060.00914.84
7.3.110.0090.00614.84
7.3.100.0060.00614.76
7.3.90.0110.00014.80
7.3.80.0030.01014.67
7.3.70.0030.01214.96
7.3.60.0090.00315.00
7.3.50.0060.00914.90
7.3.40.0090.00614.87
7.3.30.0060.01014.75
7.3.20.0060.00916.50
7.3.10.0070.01016.54
7.3.00.0090.00616.65
7.2.330.0130.00716.34
7.2.320.0090.01416.74
7.2.310.0070.01016.50
7.2.300.0100.00716.79
7.2.290.0130.00316.59
7.2.240.0070.00714.99
7.2.230.0090.00915.13
7.2.220.0040.01115.22
7.2.210.0030.01015.00
7.2.200.0110.00415.07
7.2.190.0070.00714.93
7.2.180.0060.01014.66
7.2.170.0030.00715.02
7.2.160.0040.01114.78
7.2.150.0030.01316.90
7.2.140.0090.00916.70
7.2.130.0030.01216.69
7.2.120.0060.01016.80
7.2.110.0040.01416.95
7.2.100.0030.00916.94
7.2.90.0060.01016.71
7.2.80.0090.00916.75
7.2.70.0000.01216.65
7.2.60.0020.01416.72
7.2.50.0090.00617.00
7.2.40.0030.00916.92
7.2.30.0070.01117.05
7.2.20.0060.00916.84
7.2.10.0040.00716.92
7.2.00.0160.00016.89
7.1.330.0000.01715.86
7.1.320.0060.00615.66
7.1.310.0040.01215.92
7.1.300.0030.01315.82
7.1.290.0100.00615.91
7.1.280.0100.00315.57
7.1.270.0060.00815.92
7.1.260.0080.01115.86
7.1.250.0110.00015.81
7.1.200.0060.00615.84
7.1.70.0040.00417.27
7.1.60.0110.00719.82
7.1.50.0030.02017.10
7.1.00.0070.07322.27
7.0.200.0000.00716.83
7.0.140.0000.07721.96
7.0.60.0070.06720.04
7.0.50.0070.04017.84
7.0.40.0030.07320.40
7.0.30.0300.06720.23
7.0.20.0270.08320.33
7.0.10.0230.08320.24
7.0.00.0000.04320.14
5.6.210.0130.06720.77
5.6.200.0170.07318.19
5.6.190.0030.06020.61
5.6.180.3270.04720.52
5.6.170.0300.07320.46
5.6.160.0000.04320.54
5.6.150.0030.04318.18
5.6.140.0030.04318.12
5.6.130.0170.04318.19
5.6.120.0070.04020.98
5.6.110.0030.04320.98
5.6.100.0170.07321.01
5.6.90.0070.04021.06
5.6.80.0070.06720.41
5.6.70.0400.06320.38
5.5.350.0200.07020.32
5.5.340.0130.07317.95
5.5.330.0070.08720.47
5.5.320.0170.04320.27
5.5.310.0230.04720.21
5.5.300.0070.06018.08
5.5.290.0100.07317.98
5.5.280.0100.06020.77
5.5.270.0100.04320.85
5.5.260.0030.08320.79
5.5.250.0000.09320.66
5.5.240.0000.05720.04
5.4.450.0400.07019.59
5.4.440.0600.06019.17
5.4.430.0130.05319.51
5.4.420.0100.06019.36
5.4.410.0070.06019.41
5.4.400.1430.00018.74
5.4.390.1400.00018.79
5.4.380.0200.06018.76
5.4.370.0300.05318.80
5.4.360.0230.05318.77
5.4.350.0300.06318.48
5.4.340.0430.04018.56
5.4.320.0090.03412.50
5.4.310.0080.03712.50
5.4.300.0090.04012.51
5.4.290.0100.04012.50
5.4.280.0060.04112.40
5.4.270.0030.03912.40
5.4.260.0130.05719.02
5.4.250.0200.06318.65
5.4.240.0070.07018.95
5.4.230.0030.06318.96
5.4.220.0100.06018.96
5.4.210.0270.06018.80
5.4.200.0100.07318.74
5.4.190.0100.06718.91
5.4.180.0270.05018.96
5.4.170.0100.05318.96
5.4.160.0170.06718.97
5.4.150.0100.06018.82
5.4.140.0030.06016.57
5.4.130.0200.04716.35
5.4.120.0130.06716.56
5.4.110.0170.06716.57
5.4.100.0130.06316.50
5.4.90.0200.03716.46
5.4.80.0200.06016.59
5.4.70.0130.07016.39
5.4.60.0070.05316.46
5.4.50.0130.06316.27
5.4.40.0030.06316.41
5.4.30.0130.05016.52
5.4.20.0130.05316.43
5.4.10.0100.05716.62
5.4.00.0230.04715.87
5.3.290.0130.04212.80
5.3.280.0130.08314.58
5.3.270.0100.05014.69
5.3.260.0130.07014.44
5.3.250.0130.06014.68
5.3.240.0100.05014.59
5.3.230.0070.07714.63
5.3.220.0030.07314.63
5.3.210.0130.06014.55
5.3.200.0100.05314.54
5.3.190.0130.04714.65
5.3.180.0070.06014.64
5.3.170.0070.05714.54
5.3.160.0170.06714.56
5.3.150.0000.06014.54
5.3.140.0170.04714.55
5.3.130.0230.07314.68
5.3.120.0100.05714.54
5.3.110.0070.07314.64
5.3.100.0030.05714.06
5.3.90.0130.06314.04
5.3.80.0100.05714.03
5.3.70.0230.03714.20
5.3.60.0030.05314.18
5.3.50.0170.04014.04
5.3.40.0130.04714.03
5.3.30.0030.05713.98
5.3.20.0170.06313.79
5.3.10.0200.06013.63
5.3.00.0000.08013.72
5.2.170.0130.03711.22
5.2.160.0130.03311.36
5.2.150.0030.05311.23
5.2.140.0130.05311.18
5.2.130.0100.04011.19
5.2.120.0030.05711.18
5.2.110.0130.04711.08
5.2.100.0070.04011.32
5.2.90.0030.05011.17
5.2.80.0100.05311.18
5.2.70.0030.04711.08
5.2.60.0070.06011.05
5.2.50.0070.04711.09
5.2.40.0130.04710.90
5.2.30.0070.04311.04
5.2.20.0100.04711.14
5.2.10.0030.05010.95
5.2.00.0070.04710.80
5.1.60.0070.03710.20
5.1.50.0170.03310.04
5.1.40.0100.03710.07
5.1.30.0070.04710.30
5.1.20.0070.05310.44
5.1.10.0100.0379.90
5.1.00.0030.05710.07
5.0.50.0030.0308.75
5.0.40.0000.0308.38
5.0.30.0130.0438.29
5.0.20.0030.0378.29
5.0.10.0030.0378.22
5.0.00.0030.0438.00
4.4.90.0000.0276.96
4.4.80.0030.0236.96
4.4.70.0030.0206.93
4.4.60.0030.0236.93
4.4.50.0030.0236.93
4.4.40.0100.0276.93
4.4.30.0030.0276.93
4.4.20.0030.0276.93
4.4.10.0000.0236.93
4.4.00.0070.0406.93
4.3.110.0030.0336.93
4.3.100.0000.0306.93
4.3.90.0000.0276.93
4.3.80.0030.0376.93
4.3.70.0000.0236.93
4.3.60.0030.0306.93
4.3.50.0070.0206.93
4.3.40.0000.0376.93
4.3.30.0070.0206.93
4.3.20.0000.0306.93
4.3.10.0070.0276.93
4.3.00.0130.0177.33

preferences:
41.96 ms | 401 KiB | 5 Q