3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ ['Code' => 'DES001', 'Commennte' => '', 'Quantity' => 1, 'Price' => '135.00', 'Unity' => 1] ]; // expected <value><![CDATA...</value> payload $payload = [ 'Pedido' => [ 'Nombre' => '', 'Producto' => [ 'Product' => [ [ 'ClaveProducto' => $data[0]['Code'], 'Cantidad' => $data[0]['Quantity'], 'Precio' => $data[0]['Price'], 'Unidad' => 'PIEZA', 'Comentario' => '', ] ] ], ] ]; // init domdocument $xml = new DOMDocument("1.0", "ISO-8859-15"); // optional $xml->preserveWhiteSpace = false; $xml->formatOutput = true; // create request wrapper $request = $xml->createElement("request"); // create method (CDATA), append it to the wrapper $method = $xml->createElement("method"); $method->appendChild($xml->createCDATASection('registra')); // create param wrapper $param = $xml->createElement("param"); // create name (CDATA), append it to the param $name = $xml->createElement("name"); $name->appendChild($xml->createCDATASection('pedido')); $param->appendChild($name); // create value (CDATA), append it to the param $value = $xml->createElement("value"); $value->appendChild($xml->createCDATASection(json_encode($payload))); $param->appendChild($value); // append method to request $request->appendChild($method); // append param to request $request->appendChild($param); // request root $xml->appendChild($request); // output echo $xml->saveXML($xml->documentElement);

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.0160.00618.45
8.3.50.0140.00316.61
8.3.40.0090.00619.15
8.3.30.0060.00918.84
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0030.00526.16
8.2.180.0170.00725.92
8.2.170.0100.00319.04
8.2.160.0030.01022.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0090.00026.16
8.2.120.0040.00420.05
8.2.110.0070.00321.31
8.2.100.0040.00818.09
8.2.90.0100.00019.37
8.2.80.0040.00417.97
8.2.70.0080.00017.88
8.2.60.0040.00418.18
8.2.50.0080.00018.07
8.2.40.0000.00818.47
8.2.30.0000.00718.41
8.2.20.0040.00418.22
8.2.10.0040.00419.53
8.2.00.0000.00719.57
8.1.280.0030.01025.92
8.1.270.0070.00024.27
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.84
8.1.230.0090.00317.95
8.1.220.0030.00617.78
8.1.210.0040.00418.77
8.1.200.0070.00317.60
8.1.190.0000.00817.60
8.1.180.0030.00618.10
8.1.170.0000.00818.97
8.1.160.0080.00018.99
8.1.150.0070.00019.10
8.1.140.0000.00719.03
8.1.130.0000.00720.54
8.1.120.0000.00717.65
8.1.110.0000.00917.59
8.1.100.0060.00317.60
8.1.90.0070.00517.65
8.1.80.0040.00417.64
8.1.70.0000.00717.63
8.1.60.0040.00417.72
8.1.50.0000.00817.77
8.1.40.0000.00817.69
8.1.30.0050.00317.90
8.1.20.0040.00417.82
8.1.10.0030.00517.75
8.1.00.0000.00817.79
8.0.300.0000.00718.77
8.0.290.0040.00417.00
8.0.280.0040.00418.66
8.0.270.0050.00218.09
8.0.260.0000.00618.70
8.0.250.0000.00917.06
8.0.240.0080.00017.09
8.0.230.0000.00717.10
8.0.220.0070.00017.01
8.0.210.0050.00317.11
8.0.200.0000.00817.16
8.0.190.0040.00417.08
8.0.180.0000.00817.12
8.0.170.0040.00417.05
8.0.160.0030.00617.06
8.0.150.0000.00716.98
8.0.140.0030.00617.04
8.0.130.0030.00313.50
8.0.120.0000.00817.02
8.0.110.0040.00417.07
8.0.100.0000.00817.19
8.0.90.0000.00817.11
8.0.80.0000.00817.07
8.0.70.0050.00317.19
8.0.60.0040.00417.14
8.0.50.0080.00017.18
8.0.30.0050.00317.18
8.0.20.0080.00017.02
8.0.10.0000.00817.23
8.0.00.0000.00917.29
7.4.330.0050.00015.55
7.4.320.0000.00716.85
7.4.300.0030.00316.58
7.4.290.0050.00316.66
7.4.280.0040.00416.77
7.4.270.0070.00016.58
7.4.260.0050.00013.34
7.4.250.0070.00016.87
7.4.240.0040.00416.68
7.4.230.0000.00716.60
7.4.220.0070.00016.52
7.4.210.0040.00416.91
7.4.200.0000.00716.86
7.4.190.0000.00716.54
7.4.180.0000.00717.00
7.4.160.0000.00716.52
7.4.150.0040.00416.68
7.4.140.0050.00216.77
7.4.130.0040.00416.49
7.4.120.0070.00016.51
7.4.110.0000.00716.77
7.4.100.0040.00416.48
7.4.90.0070.00016.61
7.4.80.0000.00716.75
7.4.70.0000.00716.81
7.4.60.0040.00416.75
7.4.50.0000.00816.46
7.4.40.0030.00516.63
7.4.30.0040.00416.84
7.4.20.0070.00016.72
7.4.10.0040.00416.69
7.4.00.0000.00716.75
7.3.330.0040.00416.41
7.3.320.0000.00813.21
7.3.310.0040.00416.46
7.3.300.0070.00016.40
7.3.290.0070.00016.42
7.3.280.0000.00716.30
7.3.270.0080.00016.42
7.3.260.0040.00316.43
7.3.250.0050.00316.46
7.3.240.0040.00316.45
7.3.230.0070.00016.41
7.3.220.0070.00016.30
7.3.210.0000.00716.52
7.3.200.0050.00316.27
7.3.190.0040.00316.30
7.3.180.0050.00216.40
7.3.170.0000.00916.40
7.3.160.0040.00416.23
7.3.150.0000.00916.28
7.3.140.0000.00816.26
7.3.130.0040.00416.33
7.3.120.0040.00416.30
7.3.110.0030.00316.20
7.3.100.0070.00016.24
7.3.90.0040.00416.68
7.3.80.0000.00716.34
7.3.70.0040.00416.47
7.3.60.0000.00716.44
7.3.50.0050.00216.56
7.3.40.0000.00716.52
7.3.30.0000.00716.47
7.3.20.0040.00418.26
7.3.10.0030.00618.42
7.3.00.0050.00218.16

preferences:
39.77 ms | 400 KiB | 5 Q