3v4l.org

run code in 300+ PHP versions simultaneously
<?php $csv = <<<'CSV' produit nom_pdf type_pdf prive_pdf 1 ENTREE_AIR_AUTO_RE_FR_FR_28143161 Rapport_d_essai 0 1 M_FT_FR_FR_201803 Fiche_technique 0 100 AMD+C_FT_FR_FR_201901 Fiche_technique 0 1000 APDR_FT_FR_FR_201907 Fiche_technique 0 1000 ATTESTATION_A1_CONVENTIONNELS Procès-verbal 1 CSV; $lines = explode("\n", $csv); $headers = str_getcsv(array_shift($lines), ' '); $xw = new XMLWriter(); $xw->openMemory(); $xw->startDocument("1.0", "utf-8"); $xw->setIndent(true); $xw->setIndentString(' '); $xw->startElement('Products'); $prevprod = false; foreach ( $lines as $line ) { $data = array_combine($headers, str_getcsv($line, ' ')); if ( $data['produit'] !== $prevprod ) { if ( $prevprod ) $xw->endElement(); $prevprod = $data['produit']; $xw->startElement('produit'); $xw->writeAttribute('code', $data['produit']); } $xw->startElement('Fichier'); $xw->writeAttribute('nom_fichier', $data['nom_pdf']); $xw->writeAttribute('type_fichier', $data['type_pdf']); $xw->writeAttribute('prive', $data['prive_pdf']); $xw->endElement(); } $xw->endElement(); // product (last) $xw->endElement(); // Products $xw->endDocument(); echo $xw->outputMemory();

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.130.0070.00219.01
8.4.120.0140.00624.30
8.4.110.0120.00819.25
8.4.100.0080.01118.90
8.4.90.0120.00920.51
8.4.80.0080.00120.66
8.4.70.0110.00819.14
8.4.60.0020.00719.23
8.4.50.0110.00918.79
8.4.40.0130.00317.87
8.4.30.0130.00720.70
8.4.20.0160.00619.71
8.4.10.0030.00719.74
8.3.260.0120.00716.75
8.3.250.0100.00918.98
8.3.240.0110.00817.16
8.3.230.0120.00716.87
8.3.220.0150.00319.10
8.3.210.0130.00816.83
8.3.200.0120.00416.48
8.3.190.0050.00417.34
8.3.180.0130.00718.97
8.3.170.0150.00320.73
8.3.160.0110.00719.01
8.3.150.0060.01316.76
8.3.140.0080.00019.03
8.3.130.0060.00316.83
8.3.120.0130.00619.04
8.3.110.0040.00420.94
8.3.100.0070.01324.06
8.3.90.0080.00026.77
8.3.80.0060.00318.80
8.3.70.0120.00316.58
8.3.60.0120.00318.55
8.3.50.0070.00718.26
8.3.40.0110.00422.14
8.3.30.0060.00919.04
8.3.20.0050.00324.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.290.0110.00820.82
8.2.280.0080.01120.38
8.2.270.0040.01516.88
8.2.260.0000.00816.47
8.2.250.0030.00517.14
8.2.240.0030.00617.28
8.2.230.0030.00522.58
8.2.220.0150.00637.54
8.2.210.0040.00426.77
8.2.200.0050.00518.64
8.2.190.0080.01116.75
8.2.180.0030.01825.92
8.2.170.0100.01019.04
8.2.160.0110.00422.96
8.2.150.0000.00925.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00021.07
8.2.110.0000.00920.47
8.2.100.0080.00417.97
8.2.90.0030.00517.88
8.2.80.0060.00318.88
8.2.70.0000.00817.63
8.2.60.0040.00418.05
8.2.50.0000.00818.07
8.2.40.0000.00820.20
8.2.30.0000.00918.34
8.2.20.0040.00418.31
8.2.10.0060.00321.25
8.2.00.0040.00419.45
8.1.330.0120.00722.33
8.1.320.0050.01416.48
8.1.310.0130.00618.34
8.1.300.0090.00918.56
8.1.290.0060.00630.84
8.1.280.0160.00025.92
8.1.270.0080.00023.99
8.1.260.0030.00626.35
8.1.250.0050.00328.09
8.1.240.0040.00419.13
8.1.230.0080.00317.89
8.1.220.0090.00017.80
8.1.210.0030.00618.77
8.1.200.0030.00617.36
8.1.190.0030.00517.35
8.1.180.0030.00518.10
8.1.170.0040.00420.37
8.1.160.0040.00419.00
8.1.150.0000.00718.86
8.1.140.0070.00019.08
8.1.130.0000.00718.98
8.1.120.0060.00317.68
8.1.110.0080.00017.58
8.1.100.0080.00017.59
8.1.90.0000.00717.57
8.1.80.0040.00417.68
8.1.70.0000.00717.55
8.1.60.0000.00817.73
8.1.50.0000.00817.76
8.1.40.0040.00817.63
8.1.30.0040.00417.80
8.1.20.0050.00317.83
8.1.10.0040.00417.69
8.1.00.0080.00317.61
8.0.300.0000.01018.77
8.0.290.0000.00817.00
8.0.280.0030.00318.54
8.0.270.0000.00718.28
8.0.260.0030.00318.78
8.0.250.0000.00817.14
8.0.240.0070.00017.27
8.0.230.0040.00417.11
8.0.220.0000.00917.05
8.0.210.0060.00317.12
8.0.200.0030.00617.08
8.0.190.0000.00817.11
8.0.180.0060.00317.10
8.0.170.0080.00017.18
8.0.160.0080.00317.05
8.0.150.0000.00716.98
8.0.140.0040.00417.04
8.0.130.0000.00513.57
8.0.120.0030.00617.02
8.0.110.0000.00717.01
8.0.100.0030.00617.08
8.0.90.0060.00317.18
8.0.80.0030.00616.83
8.0.70.0050.00317.18
8.0.60.0030.00616.98
8.0.50.0030.00516.98
8.0.30.0050.00316.98
8.0.20.0040.00417.07
8.0.10.0040.00417.40
8.0.00.0000.00717.37
7.4.330.0000.00515.55
7.4.320.0030.00316.71
7.4.300.0040.00416.63
7.4.290.0030.00316.69
7.4.280.0040.00416.70
7.4.270.0070.00016.72
7.4.260.0030.00313.41
7.4.250.0070.00016.66
7.4.240.0000.00816.62
7.4.230.0030.00316.85
7.4.220.0000.00716.39
7.4.210.0070.00016.62
7.4.200.0000.00816.88
7.4.190.0000.00816.99
7.4.180.0040.00416.93
7.4.160.0050.00316.84
7.4.150.0000.00716.57
7.4.140.0070.00016.52
7.4.130.0000.00716.81
7.4.120.0070.00016.74
7.4.110.0070.00016.67
7.4.100.0030.00316.56
7.4.90.0000.00716.51
7.4.80.0040.00416.35
7.4.70.0040.00416.71
7.4.60.0000.00816.32
7.4.50.0070.00016.66
7.4.40.0070.00016.64
7.4.30.0080.00016.74
7.4.20.0080.00016.37
7.4.10.0030.00316.56
7.4.00.0030.00316.75
7.3.330.0030.00616.57
7.3.320.0030.00613.39
7.3.310.0020.00516.53
7.3.300.0040.00416.59
7.3.290.0070.00016.54
7.3.280.0070.00016.60
7.3.270.0080.00016.54
7.3.260.0030.00616.41
7.3.250.0030.00316.55
7.3.240.0070.00016.50
7.3.230.0070.00016.45
7.3.220.0030.00516.39
7.3.210.0030.00516.64
7.3.200.0060.00316.40
7.3.190.0030.00616.51
7.3.180.0000.00716.41
7.3.170.0050.00216.35
7.3.160.0000.00716.52
7.3.150.0000.00716.54
7.3.140.0000.00716.52
7.3.130.0000.00716.35
7.3.120.0000.00716.35
7.3.110.0000.00816.46
7.3.100.0030.00316.43
7.3.90.0070.00016.62
7.3.80.0030.00316.37
7.3.70.0040.00416.70
7.3.60.0050.00216.63
7.3.50.0090.00016.65
7.3.40.0030.00616.63
7.3.30.0050.00316.64
7.3.20.0070.00018.45
7.3.10.0070.00018.24
7.3.00.0030.00318.32

preferences:
28.33 ms | 403 KiB | 5 Q