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""!"'; $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.5.00.0120.00920.25
8.4.150.0030.00014.05
8.4.140.0130.00817.82
8.4.130.0090.00917.72
8.4.120.0120.00821.91
8.4.110.0120.00819.13
8.4.100.0080.00817.96
8.4.90.0070.00417.79
8.4.80.0100.01017.68
8.4.70.0060.00617.88
8.4.60.0070.01418.56
8.4.50.0110.00517.96
8.4.40.0090.01217.39
8.4.30.0040.00417.67
8.4.20.0170.00317.63
8.4.10.0070.00417.57
8.3.280.0120.00818.43
8.3.270.0100.00916.56
8.3.260.0110.00716.75
8.3.250.0120.00718.96
8.3.240.0120.00716.62
8.3.230.0120.00816.55
8.3.220.0100.01017.12
8.3.210.0050.00216.80
8.3.200.0080.00318.54
8.3.190.0090.00916.94
8.3.180.0110.00816.54
8.3.170.0080.00017.16
8.3.160.0120.00618.32
8.3.150.0080.00019.16
8.3.140.0090.00618.54
8.3.130.0060.00316.58
8.3.120.0080.01118.90
8.3.110.0060.00320.94
8.3.100.0050.00224.06
8.3.90.0040.00426.77
8.3.80.0090.00017.97
8.3.70.0150.00318.30
8.3.60.0120.00918.16
8.3.50.0100.01021.99
8.3.40.0030.01218.62
8.3.30.0110.00418.71
8.3.20.0070.00020.21
8.3.10.0040.00420.48
8.3.00.0040.00418.54
8.2.290.0060.00520.49
8.2.280.0130.00718.56
8.2.270.0160.00316.48
8.2.260.0000.00818.89
8.2.250.0030.00518.40
8.2.240.0100.00019.08
8.2.230.0050.00522.58
8.2.220.0030.00737.54
8.2.210.0070.00726.77
8.2.200.0070.00416.88
8.2.190.0060.01216.62
8.2.180.0060.00917.00
8.2.170.0140.00022.96
8.2.160.0070.00720.43
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0060.00319.23
8.2.120.0050.00326.35
8.2.110.0060.00319.45
8.2.100.0110.00018.05
8.2.90.0000.00819.17
8.2.80.0030.00517.97
8.2.70.0060.00317.50
8.2.60.0030.00617.93
8.2.50.0000.00818.09
8.2.40.0000.00822.05
8.2.30.0000.00721.34
8.2.20.0040.00417.69
8.2.10.0000.00818.18
8.2.00.0020.00518.26
8.1.330.0060.00518.67
8.1.320.0120.00816.18
8.1.310.0050.00316.68
8.1.300.0060.00316.17
8.1.290.0050.00530.84
8.1.280.0060.01225.92
8.1.270.0040.00424.00
8.1.260.0050.00328.09
8.1.250.0040.00428.09
8.1.240.0040.00422.46
8.1.230.0070.00417.83
8.1.220.0050.00317.78
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0090.00017.22
8.1.180.0080.00018.10
8.1.170.0000.00818.59
8.1.160.0000.00720.79
8.1.150.0000.00718.84
8.1.140.0040.00419.52
8.1.130.0000.00717.72
8.1.120.0040.00417.49
8.1.110.0040.00417.38
8.1.100.0030.00617.52
8.1.90.0040.00417.49
8.1.80.0000.00817.46
8.1.70.0040.00417.41
8.1.60.0050.00517.55
8.1.50.0040.00417.49
8.1.40.0040.00417.43
8.1.30.0040.00417.70
8.1.20.0090.00017.69
8.1.10.0040.00417.57
8.1.00.0060.00317.52
8.0.300.0000.00918.77
8.0.290.0000.00816.88
8.0.280.0020.00518.54
8.0.270.0000.00717.29
8.0.260.0030.00317.41
8.0.250.0000.00717.05
8.0.240.0070.00017.03
8.0.230.0070.00017.04
8.0.220.0030.00317.02
8.0.210.0080.00016.88
8.0.200.0070.00016.94
8.0.190.0080.00016.91
8.0.180.0070.00317.02
8.0.170.0040.00417.02
8.0.160.0030.00416.93
8.0.150.0070.00016.97
8.0.140.0000.00816.92
8.0.130.0030.00313.40
8.0.120.0050.00316.96
8.0.110.0000.00717.05
8.0.100.0050.00216.92
8.0.90.0000.00816.77
8.0.80.0110.00417.01
8.0.70.0050.00317.05
8.0.60.0000.00716.87
8.0.50.0040.00416.97
8.0.30.0080.01017.17
8.0.20.0140.01117.40
8.0.10.0040.00416.91
8.0.00.0110.01216.81
7.4.330.0050.00016.82
7.4.320.0080.00016.61
7.4.300.0040.00416.43
7.4.290.0000.00716.56
7.4.280.0040.00416.64
7.4.270.0040.00416.57
7.4.260.0000.00716.53
7.4.250.0040.00416.49
7.4.240.0030.00416.53
7.4.230.0030.00316.43
7.4.220.0160.00716.59
7.4.210.0030.01116.70
7.4.200.0040.00316.39
7.4.160.0100.00516.35
7.4.150.0070.01017.40
7.4.140.0110.00717.86
7.4.130.0110.00716.51
7.4.120.0100.01016.51
7.4.110.0060.01216.50
7.4.100.0120.00616.55
7.4.90.0060.01216.49
7.4.80.0100.00719.39
7.4.70.0060.01016.63
7.4.60.0070.00916.49
7.4.50.0040.01116.63
7.4.40.0150.00716.38
7.4.30.0070.01016.67
7.4.00.0080.00814.93
7.3.330.0000.00613.30
7.3.320.0060.00013.10
7.3.310.0000.00716.44
7.3.300.0000.00716.41
7.3.290.0080.00816.38
7.3.280.0120.00516.44
7.3.270.0170.00717.40
7.3.260.0060.01216.67
7.3.250.0060.01216.59
7.3.240.0040.01416.51
7.3.230.0080.00816.63
7.3.210.0070.01016.19
7.3.200.0040.01216.43
7.3.190.0100.00716.43
7.3.180.0130.00316.36
7.3.170.0110.00616.40
7.3.160.0060.00916.61
7.3.120.0140.00714.75
7.3.110.0100.00615.11
7.3.100.0070.01014.88
7.3.90.0070.00714.71
7.3.80.0060.00614.86
7.3.70.0050.00314.89
7.3.60.0030.01514.96
7.3.50.0100.00314.72
7.3.40.0000.01214.87
7.3.30.0090.00614.90
7.3.20.0070.00716.68
7.3.10.0070.00516.69
7.3.00.0050.00716.51
7.2.330.0100.01316.63
7.2.320.0220.00316.59
7.2.310.0030.01416.58
7.2.300.0100.01416.52
7.2.290.0090.00916.63
7.2.250.0100.01015.30
7.2.240.0070.01315.25
7.2.230.0090.00614.92
7.2.220.0070.00715.14
7.2.210.0060.00315.11
7.2.200.0070.00415.22
7.2.190.0000.01414.74
7.2.180.0100.00615.34
7.2.170.0080.00315.03
7.2.160.0060.00314.96
7.2.150.0090.00616.71
7.2.140.0110.00016.99
7.2.130.0030.00916.87
7.2.120.0040.00816.87
7.2.110.0070.00516.89
7.2.100.0040.00616.85
7.2.90.0040.00916.92
7.2.80.0070.00816.98
7.2.70.0060.00816.89
7.2.60.0050.00516.90
7.2.50.0020.00816.96
7.2.40.0080.00516.83
7.2.30.0080.00617.11
7.2.20.0050.00816.75
7.2.10.0040.00916.92
7.2.00.0080.00517.41
7.1.330.0060.01216.02
7.1.320.0030.01015.96
7.1.310.0000.01315.77
7.1.300.0040.01115.60
7.1.290.0030.00615.97
7.1.280.0000.00815.81
7.1.270.0000.01515.54
7.1.260.0030.00715.70
7.1.250.0040.00815.91
7.1.240.0030.00615.83
7.1.230.0040.00815.83
7.1.220.0090.00615.79
7.1.210.0030.01015.77
7.1.200.0060.00815.86
7.1.190.0070.00515.77
7.1.180.0050.00715.73
7.1.170.0050.00915.90
7.1.160.0090.00315.85
7.1.150.0050.00915.78
7.1.140.0030.01115.68
7.1.130.0050.00515.86
7.1.120.0050.00815.86
7.1.110.0080.00415.90
7.1.100.0080.00316.37
7.1.90.0050.00815.71
7.1.80.0050.00715.82
7.1.70.0050.00716.10
7.1.60.0060.00716.29
7.1.50.0040.01015.88
7.1.40.0030.01015.88
7.1.30.0050.00515.81
7.1.20.0050.00815.95
7.1.10.0050.01115.82
7.1.00.0050.02417.52
7.0.330.0040.00515.34
7.0.320.0040.00815.40
7.0.310.0070.00515.38
7.0.300.0050.00815.36
7.0.290.0060.00515.46
7.0.280.0030.01115.44
7.0.270.0040.00815.36
7.0.260.0030.00815.24
7.0.250.0030.00715.54
7.0.240.0040.00915.42
7.0.230.0050.01015.45
7.0.220.0020.00915.37
7.0.210.0040.00915.25
7.0.200.0040.00615.74
7.0.190.0050.00815.49
7.0.180.0030.00815.36
7.0.170.0080.00515.36
7.0.160.0050.00715.37
7.0.150.0060.00515.49
7.0.140.0060.00415.26
7.0.130.0050.00815.51
7.0.120.0070.00515.50
7.0.110.0030.01015.33
7.0.100.0030.01015.29
7.0.90.0050.00715.33
7.0.80.0050.00815.31
7.0.70.0060.00715.37
7.0.60.0120.02216.47
7.0.50.0050.02616.00
7.0.40.0070.01915.08
7.0.30.0110.01515.12
7.0.20.0090.01615.11
7.0.10.0080.01415.15
7.0.00.0030.01715.11
5.6.400.0000.01114.25
5.6.390.0030.01014.04
5.6.380.0080.00514.44
5.6.370.0050.00314.44
5.6.360.0060.00714.33
5.6.350.0070.00614.46
5.6.340.0070.00714.49
5.6.330.0080.00814.51
5.6.320.0060.00614.33
5.6.310.0070.00814.50
5.6.300.0060.00914.48
5.6.290.0060.00614.52
5.6.280.0090.00614.20
5.6.270.0060.00614.50
5.6.260.0090.00514.43
5.6.250.0070.00614.45
5.6.240.0050.00814.57
5.6.230.0070.00714.54
5.6.220.0040.00814.50
5.6.210.0060.02315.94
5.6.200.0050.01915.30
5.6.190.0070.01615.96
5.6.180.0100.02416.01
5.6.170.0120.02015.92
5.6.160.0070.01315.86
5.6.150.0080.01515.32
5.6.140.0070.01515.29
5.6.130.0090.01215.26
5.6.120.0060.02515.90
5.6.110.0050.02816.08
5.6.100.0070.02016.21
5.6.90.0070.02816.15
5.6.80.0070.02215.82
5.6.70.0050.00914.19
5.6.60.0040.00914.28
5.6.50.0060.00614.45
5.6.40.0010.01214.39
5.6.30.0050.00814.32
5.6.20.0070.00614.13
5.6.10.0040.00914.41
5.6.00.0040.00814.46
5.5.380.0030.00412.40
5.5.370.0050.00312.38
5.5.360.0020.00612.39
5.5.350.1070.01314.23
5.5.340.0050.01813.81
5.5.330.0080.02214.35
5.5.320.0100.02414.30
5.5.310.0140.02214.25
5.5.300.0050.02613.74
5.5.290.0060.01913.79
5.5.280.0050.01714.47
5.5.270.0060.01314.48
5.5.260.0070.02314.50
5.5.250.0070.02014.38
5.5.240.0080.02514.35
5.5.230.0060.00412.45
5.5.220.0050.00512.22
5.5.210.0050.00512.19
5.5.200.0030.00612.31
5.5.190.0060.00512.26
5.5.180.0070.00212.40
5.5.170.0060.00712.38
5.5.160.0060.00712.36
5.5.150.0020.00612.31
5.5.140.0080.00412.37
5.5.130.0050.00512.31
5.5.120.0030.00912.32
5.5.110.0030.00712.39
5.5.100.0030.00712.10
5.5.90.0060.00512.34
5.5.80.0030.00712.26
5.5.70.0050.00612.25
5.5.60.0050.00612.44
5.5.50.0060.00412.39
5.5.40.0040.00712.27
5.5.30.0040.00412.23
5.5.20.0050.00512.27
5.5.10.0060.00712.30
5.5.00.0020.00812.24

preferences:
30.42 ms | 403 KiB | 5 Q