3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * You can open a sample spreadsheet at https://goo.gl/j50MKc * You can download a sample CSV at https://goo.gl/H4ni63 */ $payload = '"Hello\", World!'; $rfcCsv = '"""Hello\"", World!"'; //Contents of https://goo.gl/H4ni63 $actualRfc = str_getcsv($rfcCsv, ',', '"', '"'); echo "READING RFC CSV\n"; echo "---------------\n"; echo "To read a well formatted CSV, you must use the `double-quote` char as enclosure and\n"; echo " as escape\n"; echo sprintf("Expected: %s\n", $payload); echo sprintf("Actual : %s\n", $actualRfc[0]); echo "Equals? "; var_dump($payload === $actualRfc[0]); echo "\n\n================================================================================\n\n"; $handler = fopen('php://temp', 'w+'); echo "WRITING\n"; echo "-------\n"; if (PHP_VERSION_ID < 50504 || (defined('HHVM_VERSION_ID') && HHVM_VERSION_ID < 31100)) { // There is NO support for escape param fputcsv($handler, array($payload), ',', '"'); } else { // There is support for escape param fputcsv($handler, array($payload), ',', '"', '"'); } rewind($handler); $actual = rtrim(fgets($handler, 4096), "\n"); echo "There is no way to write a well formatted CSV even. The support for the escape param\n"; echo " in the fputcsv function do not fix the invalid format.\n"; echo sprintf("Expected: %s\n", $rfcCsv); echo sprintf("Actual : %s\n", $actual); echo "Equals? "; var_dump($rfcCsv === $actual); echo "\n\n================================================================================\n\n"; $actualPhp = str_getcsv($actual, ',', '"', '"'); echo "READING PHP CSV\n"; echo "---------------\n"; echo "If you read a PHP formatted CSV using use the `double-quote` char as enclosure and\n"; echo " as escape, the result is not the expected one.\n"; echo sprintf("Expected: %s\n", $payload); echo sprintf("Actual : %s\n", $actualPhp[0]); echo "Equals? "; var_dump($payload === $actualPhp[0]); echo "\n\n================================================================================\n\n";

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.4.20.0110.00717.76
8.4.10.0060.01017.71
8.3.150.0040.00718.89
8.3.140.0090.00918.92
8.3.130.0070.00418.29
8.3.120.0090.00018.84
8.3.110.0040.00416.79
8.3.100.0090.00016.60
8.3.90.0070.00726.77
8.3.80.0070.00319.36
8.3.70.0000.01518.27
8.3.60.0160.00618.30
8.3.50.0070.01222.12
8.3.40.0040.01518.70
8.3.30.0120.00318.63
8.3.20.0040.00420.18
8.3.10.0030.00618.76
8.3.00.0040.01120.39
8.2.260.0090.00916.89
8.2.250.0030.00618.52
8.2.240.0060.00317.28
8.2.230.0030.00620.94
8.2.220.0080.00337.54
8.2.210.0100.01026.77
8.2.200.0060.00318.88
8.2.190.0040.01118.05
8.2.180.0060.00918.42
8.2.170.0150.00022.96
8.2.160.0070.01020.47
8.2.150.0050.00325.66
8.2.140.0080.00024.66
8.2.130.0090.00626.16
8.2.120.0060.00319.97
8.2.110.0030.01019.29
8.2.100.0120.00017.85
8.2.90.0030.00618.22
8.2.80.0040.00419.11
8.2.70.0050.00317.63
8.2.60.0080.00317.63
8.2.50.0050.00317.48
8.2.40.0040.00419.48
8.2.30.0000.00818.22
8.2.20.0050.00217.84
8.2.10.0070.00018.04
8.2.00.0040.00418.03
8.1.310.0140.00418.36
8.1.300.0060.00318.04
8.1.290.0060.00330.84
8.1.280.0070.00725.92
8.1.270.0080.00022.11
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0060.00323.97
8.1.230.0040.00820.93
8.1.220.0040.00417.79
8.1.210.0030.00518.77
8.1.200.0030.00517.23
8.1.190.0000.00817.22
8.1.180.0000.00818.10
8.1.170.0090.00017.62
8.1.160.0000.00818.81
8.1.150.0070.00018.92
8.1.140.0000.00719.66
8.1.130.0040.00417.73
8.1.120.0030.00517.45
8.1.110.0000.00717.50
8.1.100.0050.00317.55
8.1.90.0000.00717.47
8.1.80.0000.00717.45
8.1.70.0040.00417.43
8.1.60.0040.00417.66
8.1.50.0040.00417.48
8.1.40.0000.00817.56
8.1.30.0080.00017.59
8.1.20.0000.00817.75
8.1.10.0060.00317.55
8.1.00.0040.00417.50
8.0.300.0030.00520.14
8.0.290.0040.00716.60
8.0.280.0000.00718.55
8.0.270.0040.00417.27
8.0.260.0030.00620.10
8.0.250.0030.00317.12
8.0.240.0030.00617.11
8.0.230.0000.00717.05
8.0.220.0000.00716.98
8.0.210.0000.00716.98
8.0.200.0020.00517.04
8.0.190.0030.00616.95
8.0.180.0040.00417.02
8.0.170.0040.00416.96
8.0.160.0000.00717.05
8.0.150.0000.00716.95
8.0.140.0000.00716.87
8.0.130.0000.00613.32
8.0.120.0060.00316.99
8.0.110.0000.00816.85
8.0.100.0040.00416.96
8.0.90.0000.00716.80
8.0.80.0110.00416.95
8.0.70.0050.00216.95
8.0.60.0040.00416.84
8.0.50.0000.00716.98
8.0.30.0090.00916.91
8.0.20.0120.00917.40
8.0.10.0000.00817.00
8.0.00.0140.00816.80
7.4.330.0050.00015.08
7.4.320.0030.00316.52
7.4.300.0000.00616.64
7.4.290.0060.00316.62
7.4.280.0030.00516.46
7.4.270.0030.00516.61
7.4.260.0060.00316.66
7.4.250.0050.00316.57
7.4.240.0000.00716.56
7.4.230.0000.00716.52
7.4.220.0070.02016.69
7.4.210.0130.00716.72
7.4.200.0030.00316.34
7.4.160.0130.00716.38
7.4.150.0130.00417.40
7.4.140.0120.01017.86
7.4.130.0090.00916.60
7.4.120.0060.01116.61
7.4.110.0120.00616.54
7.4.100.0080.01216.61
7.4.90.0070.01316.63
7.4.80.0060.00919.39
7.4.70.0080.00816.54
7.4.60.0070.01016.56
7.4.50.0100.00316.24
7.4.40.0200.00316.71
7.4.30.0070.01016.38
7.4.00.0040.01415.14
7.3.330.0000.00513.12
7.3.320.0050.00013.28
7.3.310.0030.00316.51
7.3.300.0000.00716.23
7.3.290.0000.00716.41
7.3.280.0060.01016.43
7.3.270.0140.00317.40
7.3.260.0120.00716.63
7.3.250.0080.00916.47
7.3.240.0070.01116.42
7.3.230.0060.01116.39
7.3.210.0130.00316.52
7.3.200.0070.01316.41
7.3.190.0100.00716.34
7.3.180.0030.01316.28
7.3.170.0120.00616.52
7.3.160.0110.00516.42
7.2.330.0100.01016.77
7.2.320.0000.01816.58
7.2.310.0080.00816.70
7.2.300.0090.01216.70
7.2.290.0000.01616.68
7.2.60.0000.01017.00
7.1.200.0000.01215.51
7.1.70.0000.00817.29
7.1.60.0040.01819.27
7.1.00.0070.07322.52
7.0.200.0040.00416.74
7.0.70.0100.06721.68
7.0.60.0030.08721.76
7.0.50.0070.07022.06
7.0.40.0070.05020.11
7.0.30.0170.07720.09
7.0.20.0000.09019.95
7.0.10.0030.07720.13
7.0.00.0030.05320.18
5.6.280.0070.07020.94
5.6.220.0130.07720.63
5.6.210.0130.07320.68
5.6.200.0130.08021.14
5.6.190.0100.07020.95
5.6.180.0070.08321.17
5.6.170.0070.04021.09
5.6.160.0030.05320.97
5.6.150.0030.08721.18
5.6.140.0100.07321.09
5.6.130.0070.08321.00
5.6.120.0130.04721.11
5.6.110.0100.03721.12
5.6.100.0000.06721.05
5.6.90.0000.04721.03
5.6.80.0070.03720.48
5.6.70.0030.04020.43
5.6.60.0130.06720.48
5.6.50.0000.04320.43
5.6.40.0070.04720.30
5.6.30.0000.04020.48
5.6.20.0000.04320.42
5.6.10.0070.03320.32
5.6.00.0000.04020.39
5.5.360.0070.08720.54
5.5.350.0170.07320.35
5.5.340.0100.07020.89
5.5.330.0070.08020.93
5.5.320.0070.08020.84
5.5.310.0070.05720.92
5.5.300.0100.04720.82
5.5.290.0030.09020.91
5.5.280.0130.03320.88
5.5.270.0030.04720.89
5.5.260.0030.04320.87
5.5.250.0030.04020.66
5.5.240.0100.03320.26
5.5.230.0030.04020.15
5.5.220.0030.04020.27
5.5.210.0030.04020.31
5.5.200.0070.04020.20
5.5.190.0030.03720.19
5.5.180.0070.03320.09
5.5.160.0070.03720.19
5.5.150.0000.04720.21
5.5.140.0070.06320.24
5.5.130.0070.03320.21
5.5.120.0000.04320.27
5.5.110.0030.04320.20
5.5.100.0000.04020.18
5.5.90.0130.06720.14
5.5.80.0070.06020.06
5.5.70.0030.03720.10
5.5.60.0000.04020.01
5.5.50.0000.04020.09
5.5.40.0030.03720.15
5.5.30.0000.04020.06
5.5.20.0000.06319.93
5.5.10.0030.05320.10
5.5.00.0000.03320.06
5.4.450.0100.07719.13
5.4.440.0070.03719.22
5.4.430.0030.04019.29
5.4.420.0070.06319.13
5.4.410.0070.03719.28
5.4.400.0000.04018.79
5.4.390.0030.04019.14
5.4.380.0030.03718.84
5.4.370.0000.04019.15
5.4.360.0030.04318.98
5.4.350.0000.03719.09
5.4.340.0000.04018.98
5.4.320.0030.03719.02
5.4.310.0030.03718.78
5.4.300.0000.05019.11
5.4.290.0000.04019.10
5.4.280.0000.04018.94
5.4.270.0000.04019.02
5.4.260.0000.03719.18
5.4.250.0000.04319.22
5.4.240.0030.03018.78
5.4.230.0000.03719.02
5.4.220.0030.03718.97
5.4.210.0030.03319.13
5.4.200.0030.03319.02
5.4.190.0070.02718.93
5.4.180.0070.02718.84
5.4.170.0000.03719.04
5.4.160.0000.03718.77
5.4.150.0030.03019.05
5.4.140.0000.03716.29
5.4.130.0030.03316.29
5.4.120.0030.03016.28
5.4.110.0070.03316.42
5.4.100.0000.08316.26
5.4.90.0070.05316.36
5.4.80.0100.07016.25
5.4.70.0000.05316.26
5.4.60.0070.07016.36
5.4.50.0030.03716.47
5.4.40.0030.03316.24
5.4.30.0000.07016.23
5.4.20.0030.06316.23
5.4.10.0030.03316.37
5.4.00.0030.05015.82
5.3.290.0000.04014.68
5.3.280.0030.03314.48
5.3.270.0100.04314.48
5.3.260.0000.03714.46
5.3.250.0000.03714.59
5.3.240.0070.03714.56
5.3.230.0030.03714.48
5.3.220.0000.03014.57
5.3.210.0070.07714.52
5.3.200.0030.05714.45
5.3.190.0000.05714.57
5.3.180.0000.04314.42
5.3.170.0000.08314.58
5.3.160.0000.07314.49
5.3.150.0100.06314.59
5.3.140.0000.04014.41
5.3.130.0030.04314.41
5.3.120.0030.07314.54
5.3.110.0000.04014.43
5.3.100.0070.04014.05
5.3.90.0070.07314.05
5.3.80.0000.05313.91
5.3.70.0000.04313.98
5.3.60.0000.03713.97
5.3.50.0030.04713.92
5.3.40.0000.03713.83
5.3.30.0000.03713.84
5.3.20.0000.05313.67
5.3.10.0100.06013.65
5.3.00.0030.06313.65
5.2.170.0030.03713.31
5.2.160.0030.02713.31
5.2.150.0030.06013.31
5.2.140.0070.05313.31
5.2.130.0030.04013.31
5.2.120.0000.06013.31
5.2.110.0000.05713.31
5.2.100.0030.05313.31
5.2.90.0030.05713.31
5.2.80.0000.04313.31
5.2.70.0000.05713.31
5.2.60.0000.06313.31
5.2.50.0070.06013.31
5.2.40.0030.03013.31
5.2.30.0100.05713.31
5.2.20.0130.05313.31
5.2.10.0000.03013.31
5.2.00.0000.04313.31
5.1.60.0000.05013.31
5.1.50.0030.04713.31
5.1.40.0030.04313.31
5.1.30.0030.05313.31
5.1.20.0000.05313.31
5.1.10.0000.05313.31
5.1.00.0070.04713.31
5.0.50.0070.03313.31
5.0.40.0000.02713.31
5.0.30.0000.04313.31
5.0.20.0000.04713.31
5.0.10.0000.03713.31
5.0.00.0030.05013.31
4.4.90.0030.03313.31
4.4.80.0030.03313.31
4.4.70.0000.03313.31
4.4.60.0030.02313.31
4.4.50.0000.04013.31
4.4.40.0000.02313.31
4.4.30.0030.03313.31
4.4.20.0000.03713.31
4.4.10.0000.03713.31
4.4.00.0030.04013.31
4.3.110.0070.03013.31
4.3.100.0000.02013.31
4.3.90.0030.03313.31
4.3.80.0000.04013.31
4.3.70.0000.02313.31
4.3.60.0000.02013.31
4.3.50.0000.02713.31
4.3.40.0000.02313.31
4.3.30.0000.02013.31
4.3.20.0030.02013.31
4.3.10.0000.01713.31
4.3.00.0000.03713.31

preferences:
36.83 ms | 403 KiB | 5 Q