3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ ['Code' => 'DES001', 'Commennte' => '', 'Quantity' => 1, 'Price' => '145.00', 'Unity' => 1], ['Code' => 'DES002', 'Commennte' => '', 'Quantity' => 5, 'Price' => '133.00', 'Unity' => 1], ['Code' => 'DES003', 'Commennte' => '', 'Quantity' => 9, 'Price' => '125.00', 'Unity' => 1], ]; // expected <value><![CDATA...</value> payload $payload = [ 'Pedido' => [ 'Nombre' => '', 'Producto' => [ 'Product' => array_map(function($v) { return [ 'ClaveProducto' => $v['Code'], 'Cantidad' => $v['Quantity'], 'Precio' => $v['Price'], 'Unidad' => 'PIEZA', 'Comentario' => '', ]; }, $data) ], ] ]; // 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.0090.00616.75
8.3.50.0150.00616.29
8.3.40.0030.01318.76
8.3.30.0130.00618.93
8.3.20.0030.00624.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.180.0040.01125.92
8.2.170.0070.00718.88
8.2.160.0170.00322.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0000.00821.01
8.2.110.0040.00420.55
8.2.100.0080.00417.97
8.2.90.0000.00818.00
8.2.80.0080.00019.04
8.2.70.0090.00018.18
8.2.60.0060.00318.34
8.2.50.0040.00418.10
8.2.40.0050.00321.46
8.2.30.0040.00419.40
8.2.20.0040.00418.33
8.2.10.0020.00519.55
8.2.00.0050.00319.33
8.1.280.0150.00025.92
8.1.270.0050.00323.99
8.1.260.0030.00626.35
8.1.250.0050.00328.09
8.1.240.0070.00322.26
8.1.230.0060.00617.82
8.1.220.0040.00417.88
8.1.210.0030.00618.77
8.1.200.0060.00317.48
8.1.190.0060.00317.34
8.1.180.0060.00318.10
8.1.170.0050.00318.76
8.1.160.0080.00018.96
8.1.150.0040.00419.09
8.1.140.0040.00419.07
8.1.130.0070.00017.55
8.1.120.0000.00717.71
8.1.110.0040.00417.62
8.1.100.0040.00417.59
8.1.90.0040.00417.61
8.1.80.0030.00717.71
8.1.70.0030.00317.55
8.1.60.0000.00917.80
8.1.50.0000.00917.62
8.1.40.0030.00517.68
8.1.30.0050.00317.77
8.1.20.0030.00617.76
8.1.10.0000.00817.80
8.1.00.0050.00517.59
8.0.300.0060.00320.16
8.0.290.0040.00417.00
8.0.280.0000.00718.68
8.0.270.0030.00316.87
8.0.260.0030.00316.93
8.0.250.0030.00317.17
8.0.240.0000.00717.05
8.0.230.0040.00417.00
8.0.220.0000.00717.04
8.0.210.0000.00817.04
8.0.200.0030.00317.08
8.0.190.0000.00817.04
8.0.180.0030.00517.05
8.0.170.0000.00816.98
8.0.160.0040.00417.10
8.0.150.0040.00417.13
8.0.140.0000.00816.96
8.0.130.0000.00613.60
8.0.120.0060.00316.99
8.0.110.0030.00516.92
8.0.100.0050.00316.85
8.0.90.0030.00516.87
8.0.80.0000.00816.97
8.0.70.0000.00717.12
8.0.60.0070.00016.89
8.0.50.0040.00416.88
8.0.30.0000.00717.09
8.0.20.0050.00317.14
8.0.10.0040.00417.29
8.0.00.0000.00817.08
7.4.330.0000.00515.55
7.4.320.0030.00316.64
7.4.300.0030.00316.72
7.4.290.0020.00516.50
7.4.280.0070.00016.74
7.4.270.0050.00316.65
7.4.260.0030.00313.52
7.4.250.0040.00416.72
7.4.240.0030.00516.66
7.4.230.0030.00316.54
7.4.220.0030.00316.73
7.4.210.0080.00016.83
7.4.200.0030.00316.55
7.4.190.0000.00816.52
7.4.180.0040.00416.84
7.4.160.0070.00016.88
7.4.150.0000.00716.80
7.4.140.0070.00016.73
7.4.130.0000.00716.75
7.4.120.0000.00716.70
7.4.110.0030.00316.73
7.4.100.0030.00316.56
7.4.90.0070.00016.52
7.4.80.0030.00316.38
7.4.70.0070.00016.73
7.4.60.0000.00716.71
7.4.50.0030.00316.47
7.4.40.0040.00416.72
7.4.30.0000.00716.36
7.4.20.0030.00516.74
7.4.10.0070.00016.50
7.4.00.0000.00816.87
7.3.330.0060.00616.44
7.3.320.0000.00513.44
7.3.310.0030.00316.45
7.3.300.0070.00016.51
7.3.290.0000.00616.36
7.3.280.0000.00716.59
7.3.270.0080.00016.43
7.3.260.0030.00316.36
7.3.250.0000.00716.38
7.3.240.0070.00016.55
7.3.230.0030.00316.53
7.3.220.0030.00316.48
7.3.210.0000.00716.31
7.3.200.0030.00316.32
7.3.190.0000.00716.24
7.3.180.0000.00816.29
7.3.170.0030.00316.52
7.3.160.0030.00316.33
7.3.150.0040.00416.46
7.3.140.0050.00316.49
7.3.130.0000.00816.49
7.3.120.0030.00316.29
7.3.110.0030.00316.25
7.3.100.0000.00716.25
7.3.90.0030.00516.57
7.3.80.0040.00416.45
7.3.70.0070.00016.45
7.3.60.0040.00416.54
7.3.50.0040.00416.45
7.3.40.0000.00716.46
7.3.30.0050.00216.71
7.3.20.0030.00518.24
7.3.10.0040.00418.39
7.3.00.0070.00018.38

preferences:
69.26 ms | 400 KiB | 5 Q