3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html> <head> INSERT VALUES OF THE GIVEN PHRASE IDS :</head> <!-- <head> <link rel="stylesheet" type="text/css" href="style.css" /></head> --> <body> <form name="form" action="" method="post"> <?php $file = <<<XML <?xml version="1.0"?> <?xml-stylesheet href="catalog.xsl" type="text/xsl"?> <!DOCTYPE catalog SYSTEM "catalog.dtd"> <catalog> <product description="Cardigan Sweater" id="123" value="" product_image="cardigan.jpg"> <catalog_item gender="Men's"> <size description="Medium"> <color_swatch image="red_cardigan.jpg" id="color" value="Red"/> <color_swatch image="burgundy_cardigan.jpg" id="color" value="burgundy"/> </size> <size description="Large"> <color_swatch image="red_cardigan.jpg" id="color" value="Red"/> <color_swatch image="burgundy_cardigan.jpg" id="color" value="burgundy"/> </size> </catalog_item> </product> </catalog> XML; /** * @param SimpleXMLElement $node current node to process * @param int $level Depth in the XML tree * @param string $fieldPrefix */ function makeNodeField(SimpleXMLElement $node, $level, $fieldPrefix = "") { // Indentation with the node level $indent = str_repeat(" ", $level); echo $indent, $node->getName(), PHP_EOL; $fieldName = $fieldPrefix; // If there's an ID on the node, display it and show a text field if (isset($node['id'])) { echo $indent, strval($node['id']), ' '; if (!empty($fieldPrefix)) { $fieldName .= '_'; } $fieldName .= $node->getName() . '_' . strval($node['id']); printf('<input type="text" name="%s" value="%s" /><br/>', $fieldName, strval($node['value'])); echo PHP_EOL; } $count = 0; foreach ($node as $childNode) { // put a prefix in the children field name to get a valid field name for POST $childPrefix = $fieldName; if (!empty($fieldPrefix)) { $childPrefix = $fieldName . '_' . $count++; } makeNodeField($childNode, $level + 1, $childPrefix); } } $xml = simplexml_load_string($file); makeNodeField($xml, 0); ?> </form> </body> </html>

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.0020.00919.54
8.4.120.0100.01020.66
8.4.110.0090.01119.35
8.4.100.0140.00718.97
8.4.90.0170.00418.88
8.4.80.0140.00319.77
8.4.70.0120.00818.01
8.4.60.0120.00819.02
8.4.50.0090.01119.64
8.4.40.0100.01017.89
8.4.30.0100.01017.84
8.4.20.0150.00617.78
8.4.10.0030.00617.80
8.3.260.0160.00416.68
8.3.250.0060.00317.52
8.3.240.0100.01016.90
8.3.230.0100.00916.92
8.3.220.0070.01117.64
8.3.210.0110.00916.88
8.3.200.0050.00416.84
8.3.190.0110.00519.14
8.3.180.0120.00716.98
8.3.170.0070.00717.51
8.3.160.0090.00916.99
8.3.150.0140.00422.98
8.3.140.0040.00416.84
8.3.130.0060.00318.49
8.3.120.0080.00021.04
8.3.110.0040.00420.94
8.3.100.0080.00024.06
8.3.90.0110.00726.77
8.3.80.0070.00417.97
8.3.70.0060.01218.56
8.3.60.0070.00716.88
8.3.50.0110.00821.29
8.3.40.0090.00619.24
8.3.30.0040.01119.33
8.3.20.0060.00320.55
8.3.10.0070.00022.10
8.3.00.0040.00417.75
8.2.290.0070.01220.44
8.2.280.0090.01118.64
8.2.270.0060.01216.84
8.2.260.0030.01019.14
8.2.250.0030.00718.58
8.2.240.0030.00619.13
8.2.230.0070.00322.58
8.2.220.0000.00837.54
8.2.210.0110.00726.77
8.2.200.0060.00317.00
8.2.190.0160.00017.04
8.2.180.0130.00618.67
8.2.170.0120.00322.96
8.2.160.0070.00720.64
8.2.150.0030.00625.66
8.2.140.0040.00424.66
8.2.130.0090.00026.16
8.2.120.0080.00019.39
8.2.110.0030.00719.64
8.2.100.0080.00318.16
8.2.90.0040.00421.32
8.2.80.0060.00318.29
8.2.70.0030.00718.18
8.2.60.0000.00818.41
8.2.50.0000.00818.10
8.2.40.0000.00720.80
8.2.30.0000.00718.24
8.2.20.0040.00417.99
8.2.10.0040.00418.12
8.2.00.0010.00818.26
8.1.330.0120.00622.24
8.1.320.0130.01316.45
8.1.310.0030.00517.18
8.1.300.0050.00320.14
8.1.290.0000.01030.84
8.1.280.0070.00725.92
8.1.270.0030.00522.28
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00322.86
8.1.230.0040.00819.47
8.1.220.0000.00818.01
8.1.210.0080.00019.27
8.1.200.0040.00417.48
8.1.190.0000.00917.35
8.1.180.0000.00818.10
8.1.170.0040.00418.75
8.1.160.0020.00522.13
8.1.150.0000.00719.14
8.1.140.0020.00617.66
8.1.130.0040.00317.88
8.1.120.0020.00617.75
8.1.110.0040.00417.64
8.1.100.0050.00317.67
8.1.90.0050.00317.71
8.1.80.0050.00317.74
8.1.70.0040.00417.74
8.1.60.0040.00417.73
8.1.50.0040.00417.73
8.1.40.0010.00717.75
8.1.30.0010.00717.84
8.1.20.0040.00417.83
8.1.10.0050.00317.75
8.1.00.0030.00617.72
8.0.300.0030.00621.80
8.0.290.0040.00416.88
8.0.280.0000.00718.67
8.0.270.0030.00517.09
8.0.260.0020.00517.30
8.0.250.0040.00417.23
8.0.240.0030.00417.20
8.0.230.0030.00417.14
8.0.220.0040.00417.09
8.0.210.0050.00217.08
8.0.200.0070.00217.19
8.0.190.0040.00417.21
8.0.180.0040.00717.19
8.0.170.0060.00317.22
8.0.160.0060.00417.19
8.0.150.0040.00417.05
8.0.140.0050.00317.15
8.0.130.0020.00515.30
8.0.120.0020.00717.05
8.0.110.0010.00817.09
8.0.100.0040.00517.02
8.0.90.0050.00417.13
8.0.80.0080.00917.10
8.0.70.0040.00517.10
8.0.60.0060.00417.06
8.0.50.0040.00417.14
8.0.30.0120.00817.36
8.0.20.0110.00517.30
8.0.10.0050.00417.30
8.0.00.0060.01116.99
7.4.330.0010.00514.76
7.4.320.0140.00216.70
7.4.300.0100.00316.74
7.4.290.0110.00416.71
7.4.280.0120.00416.74
7.4.270.0100.00316.81
7.4.260.0070.00716.70
7.4.250.0070.00616.72
7.4.240.0040.00616.71
7.4.230.0060.00516.75
7.4.220.0080.01216.68
7.4.210.0120.00616.72
7.4.200.0010.00916.77
7.4.190.0150.00016.71
7.4.180.0150.00016.74
7.4.160.0090.00816.83
7.4.150.0040.01316.98
7.4.140.0140.00817.45
7.4.130.0110.00616.63
7.4.120.0070.01016.75
7.4.110.0100.00916.77
7.4.100.0040.01216.71
7.4.90.0120.00516.62
7.4.80.0080.01018.05
7.4.70.0130.00316.65
7.4.60.0090.00716.74
7.4.50.0080.00416.64
7.4.40.0110.00916.76
7.4.30.0080.00716.62
7.4.20.0080.00516.63
7.4.10.0100.00316.67
7.4.00.0100.00515.89
7.3.330.0060.00415.15
7.3.320.0120.00214.98
7.3.310.0080.00216.57
7.3.300.0070.00416.66
7.3.290.0060.00916.63
7.3.280.0130.00616.68
7.3.270.0090.00716.93
7.3.260.0120.00516.55
7.3.250.0120.00816.67
7.3.240.0100.00716.63
7.3.230.0110.00516.75
7.3.220.0070.01116.36
7.3.210.0080.00916.63
7.3.200.0120.00417.97
7.3.190.0100.00716.63
7.3.180.0080.00716.54
7.3.170.0080.01116.58
7.3.160.0090.00816.64
7.3.150.0110.00416.59
7.3.140.0130.00316.62
7.3.130.0160.00016.53
7.3.120.0090.00615.68
7.3.110.0070.00915.65
7.3.100.0030.01015.69
7.3.90.0110.00715.88
7.3.80.0080.00615.67
7.3.70.0080.00515.77
7.3.60.0110.00515.84
7.3.50.0090.00415.82
7.3.40.0100.00215.72
7.3.30.0100.00515.81
7.3.20.0160.00216.68
7.3.10.0030.01116.76
7.3.00.0080.00516.60
7.2.340.0040.01316.63
7.2.330.0100.00716.74
7.2.320.0070.00816.69
7.2.310.0130.00416.80
7.2.300.0120.00716.71
7.2.290.0150.00516.82
7.2.280.0080.00816.52
7.2.270.0070.00716.46
7.2.260.0060.00916.60
7.2.250.0100.00715.97
7.2.240.0130.00215.86
7.2.230.0110.00515.90
7.2.220.0060.01015.79
7.2.210.0070.00715.94
7.2.200.0130.00316.02
7.2.190.0100.00515.91
7.2.180.0080.00915.97
7.2.170.0080.00616.04
7.2.160.0110.00515.99
7.2.150.0130.00116.81
7.2.140.0100.00616.87
7.2.130.0090.00417.05
7.2.120.0060.00616.89
7.2.110.0090.00616.89
7.2.100.0090.00716.80
7.2.90.0100.00716.92
7.2.80.0090.00716.91
7.2.70.0100.00516.88
7.2.60.0060.00917.02
7.2.50.0110.00416.94
7.2.40.0100.00317.06
7.2.30.0090.00616.82
7.2.20.0190.00517.13
7.2.10.0050.00917.02
7.2.00.0090.00717.14
7.1.330.0100.00415.82
7.1.320.0120.00315.81
7.1.310.0090.00515.92
7.1.300.0090.00515.82
7.1.290.0090.00415.82
7.1.280.0070.00615.78
7.1.270.0060.00715.80
7.1.260.0070.00515.76
7.1.250.0110.00315.62
7.1.240.0110.00715.71
7.1.230.0090.00615.50
7.1.220.0160.00015.78
7.1.210.0150.00015.59
7.1.200.0100.00315.86
7.1.190.0090.00515.77
7.1.180.0110.00615.71
7.1.170.0160.00015.57
7.1.160.0090.00615.66
7.1.150.0140.00015.71
7.1.140.0320.00015.71
7.1.130.0130.00315.73
7.1.120.0110.00615.57
7.1.110.0100.00715.54
7.1.100.0110.00415.55
7.1.90.0090.00615.71
7.1.80.0070.00715.77
7.1.70.0090.00616.21
7.1.60.0090.01216.43
7.1.50.0070.00616.24
7.1.40.0070.00916.25
7.1.30.0060.00716.20
7.1.20.0090.00816.21
7.1.10.0110.00416.17
7.1.00.0070.00516.25
7.0.330.0030.01115.41
7.0.320.0050.00915.22
7.0.310.0130.00315.15
7.0.300.0170.00015.38
7.0.290.0070.00715.22
7.0.280.0150.00015.29
7.0.270.0090.00515.41
7.0.260.0240.00315.30
7.0.250.0110.00315.52
7.0.240.0150.00015.54
7.0.230.0040.01215.54
7.0.220.0110.00515.33
7.0.210.0080.00815.48
7.0.200.0080.00315.99
7.0.190.0050.00616.05
7.0.180.0050.00815.81
7.0.170.0060.00516.01
7.0.160.0080.00615.83
7.0.150.0070.00815.91
7.0.140.0060.00616.03
7.0.130.0050.00516.04
7.0.120.0100.00416.10
7.0.110.0070.00416.01
7.0.100.0090.00415.92
7.0.90.0100.00215.88
7.0.80.0090.00315.95
7.0.70.0070.00615.81
7.0.60.0040.00815.90
7.0.50.0050.01015.97
7.0.40.0140.00615.83
7.0.30.0080.00415.93
7.0.20.0030.00915.90
7.0.10.0090.00415.95
7.0.00.0080.00515.87
5.6.400.0140.00015.99
5.6.390.0150.00016.07
5.6.380.0140.00016.01
5.6.370.0070.00716.13
5.6.360.0130.00015.96
5.6.350.0130.00016.21
5.6.340.0000.01616.00
5.6.330.0100.00316.05
5.6.320.0090.00516.23
5.6.310.0140.00016.25
5.6.300.0090.04418.41
5.6.290.0130.02718.57
5.6.280.0200.01918.51
5.6.270.0070.02118.48
5.6.260.0070.02318.57
5.6.250.0050.02718.54
5.6.240.0070.02618.53
5.6.230.0080.02718.56
5.6.220.0080.02718.62
5.6.210.0130.02118.71
5.6.200.0030.02618.57
5.6.190.0030.03218.60
5.6.180.0080.02918.63
5.6.170.0070.02118.53
5.6.160.0050.04018.49
5.6.150.0090.02118.47
5.6.140.0100.04118.71
5.6.130.0050.02618.58
5.6.120.0070.02818.62
5.6.110.0180.02218.55
5.6.100.0090.02418.50
5.6.90.0050.02318.58
5.6.80.0090.02318.18
5.6.70.0040.02618.38
5.6.60.0090.02118.24
5.6.50.0040.02818.27
5.6.40.0030.02718.35
5.6.30.0040.02318.30
5.6.20.0050.02218.22
5.6.10.0070.02218.33
5.6.00.0080.02118.20
5.5.380.0050.02317.00
5.5.370.0120.03316.85
5.5.360.0030.02916.79
5.5.350.0000.02916.82
5.5.340.0050.02317.12
5.5.330.0060.03517.01
5.5.320.0050.02617.09
5.5.310.0100.02217.17
5.5.300.0020.02717.19
5.5.290.0080.02517.03
5.5.280.0080.02117.12
5.5.270.0040.02917.14
5.5.260.0130.02517.09
5.5.250.0090.02217.10
5.5.240.0070.02116.90
5.5.230.0070.02216.71
5.5.220.0050.02416.75
5.5.210.0030.03716.70
5.5.200.0060.02216.82
5.5.190.0060.02116.55
5.5.180.0080.01816.66
5.5.170.0110.00315.96
5.5.160.0060.02216.68
5.5.150.0080.01916.57
5.5.140.0060.02016.70
5.5.130.0070.02216.72
5.5.120.0080.01816.67
5.5.110.0040.02616.69
5.5.100.0090.02416.74
5.5.90.0070.01916.70
5.5.80.0190.01916.82
5.5.70.0120.01916.82
5.5.60.0040.02616.79
5.5.50.0100.02216.81
5.5.40.0030.02316.77
5.5.30.0160.01616.83
5.5.20.0050.02516.58
5.5.10.0000.03416.63
5.5.00.0120.02516.76
5.4.450.0000.02716.94
5.4.440.0040.02516.81
5.4.430.0070.02016.87
5.4.420.0020.02616.95
5.4.410.0040.02316.77
5.4.400.0070.02116.75
5.4.390.0080.02116.79
5.4.380.0060.01916.72
5.4.370.0080.01816.78
5.4.360.0040.02416.66
5.4.350.0070.01816.77
5.4.340.0080.01816.79
5.4.330.0070.00314.29
5.4.320.0080.02116.65
5.4.310.0060.02116.79
5.4.300.0050.02016.65
5.4.290.0060.02016.67
5.4.280.0050.02116.65
5.4.270.0040.02316.77
5.4.260.0100.01716.65
5.4.250.0030.02716.70
5.4.240.0100.01816.66
5.4.230.0040.02316.67
5.4.220.0070.02216.77
5.4.210.0090.01916.67
5.4.200.0050.02116.77
5.4.190.0090.02116.74
5.4.180.0070.02416.79
5.4.170.0020.02516.77
5.4.160.0050.02316.67
5.4.150.0070.02116.72
5.4.140.0090.01915.55
5.4.130.0080.02015.56
5.4.120.0000.02515.59
5.4.110.0060.01815.61
5.4.100.0030.02215.59
5.4.90.0050.02115.56
5.4.80.0060.02015.53
5.4.70.0140.01915.64
5.4.60.0040.02215.55
5.4.50.0120.03315.59
5.4.40.0090.02115.60
5.4.30.0070.01915.63
5.4.20.0140.01415.51
5.4.10.0080.01715.59
5.4.00.0060.01915.35

preferences:
28.38 ms | 403 KiB | 5 Q