3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * How to get SVG tag content with PHP * @link http://stackoverflow.com/a/16234458/367456 */ $string = <<<BUFFER <?xml version="1.0" encoding="utf-8"?> <!-- comment --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="202.5px" height="226.084px" viewBox="0 0 202.5 226.084" enable-background="new 0 0 202.5 226.084" xml:space="preserve"> <g> <path d="M0,13.628c47.7940,13.628z"/> <polygon points="108.48,207.874 145.506,196.948 145.506,204.536 108.48,214.854 "/> <path fill="none" stroke="#000000" d="M114.55,223.959"/> </g> </svg> BUFFER; $xml = simplexml_load_string('<polygon points="108.48,207.874 145.506,196.948 145.506,204.536 108.48,214.854 "/>'); $xml->registerXPathNamespace('svg', 'http://www.w3.org/2000/svg'); $xml->addAttribute('type', 'documentary'); //$xml->xpath('g/path')[0]->asXML('php://output'); print_r($xml);

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.70.0140.00716.63
8.3.60.0100.00718.81
8.3.50.0180.00522.12
8.3.40.0040.01118.89
8.3.30.0090.00618.85
8.3.20.0080.00018.96
8.3.10.0050.00321.41
8.3.00.0090.00023.86
8.2.180.0110.00717.00
8.2.170.0000.01422.96
8.2.160.0100.00320.64
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0080.00021.23
8.2.110.0060.00322.58
8.2.100.0080.00418.09
8.2.90.0040.00419.33
8.2.80.0040.00419.63
8.2.70.0040.00417.88
8.2.60.0040.00418.28
8.2.50.0050.00318.07
8.2.40.0050.00318.28
8.2.30.0040.00419.74
8.2.20.0030.00717.81
8.2.10.0070.00018.05
8.2.00.0040.00417.86
8.1.280.0070.00725.92
8.1.270.0000.00723.99
8.1.260.0060.01226.35
8.1.250.0070.00028.09
8.1.240.0070.00322.56
8.1.230.0110.00021.18
8.1.220.0050.00318.77
8.1.210.0000.00819.09
8.1.200.0110.00717.00
8.1.190.0000.00817.65
8.1.180.0080.00018.10
8.1.170.0050.00318.87
8.1.160.0000.00719.11
8.1.150.0040.00418.88
8.1.140.0040.00417.68
8.1.130.0030.00518.16
8.1.120.0000.00717.56
8.1.110.0000.00717.84
8.1.100.0050.00317.73
8.1.90.0040.00417.76
8.1.80.0050.00217.77
8.1.70.0040.00417.60
8.1.60.0030.00617.75
8.1.50.0080.00017.84
8.1.40.0080.00017.66
8.1.30.0040.00417.94
8.1.20.0050.00317.91
8.1.10.0040.00417.63
8.1.00.0070.00017.78
8.0.300.0060.00320.26
8.0.290.0070.00017.43
8.0.280.0040.00418.69
8.0.270.0070.00017.49
8.0.260.0040.00417.16
8.0.250.0000.00817.26
8.0.240.0050.00317.34
8.0.230.0000.00817.11
8.0.220.0000.00917.08
8.0.210.0000.00717.22
8.0.200.0000.00817.35
8.0.190.0030.00617.14
8.0.180.0000.00817.12
8.0.170.0060.00317.22
8.0.160.0000.00717.07
8.0.150.0040.00417.10
8.0.140.0040.00417.24
8.0.130.0030.00313.66
8.0.120.0030.00517.06
8.0.110.0040.00417.03
8.0.100.0050.00217.25
8.0.90.0000.00717.18
8.0.80.0060.00917.15
8.0.70.0040.00417.18
8.0.60.0000.00817.20
8.0.50.0000.00717.23
8.0.30.0030.01617.46
8.0.20.0070.01217.47
8.0.10.0040.00417.31
8.0.00.0110.01017.09
7.4.330.0000.00517.13
7.4.320.0000.00616.75
7.4.300.0000.00616.66
7.4.290.0030.00316.84
7.4.280.0030.00316.91
7.4.270.0000.00716.82
7.4.260.0050.00013.46
7.4.250.0000.00916.72
7.4.240.0040.00416.76
7.4.230.0070.00016.69
7.4.220.0110.00716.76
7.4.210.0060.00916.81
7.4.200.0000.00716.68
7.4.190.0030.00316.83
7.4.160.0030.01316.88
7.4.150.0110.00717.40
7.4.140.0060.01317.86
7.4.130.0090.00916.76
7.4.120.0050.01216.79
7.4.110.0030.01316.71
7.4.100.0090.01016.93
7.4.90.0110.00716.83
7.4.80.0160.00719.39
7.4.70.0090.01216.77
7.4.60.0160.00716.82
7.4.50.0000.00716.69
7.4.40.0100.00722.77
7.4.30.0080.00816.74
7.4.00.0050.00915.02
7.3.330.0030.00413.30
7.3.320.0000.00813.35
7.3.310.0080.00016.40
7.3.300.0030.00316.36
7.3.290.0060.01316.50
7.3.280.0120.00416.57
7.3.270.0200.00317.40
7.3.260.0140.00418.24
7.3.250.0080.01116.62
7.3.240.0070.01016.50
7.3.230.0090.00916.40
7.3.210.0070.01016.55
7.3.200.0140.00319.39
7.3.190.0100.01016.45
7.3.180.0060.01016.52
7.3.170.0100.01016.79
7.3.160.0090.00616.39
7.3.120.0050.01015.05
7.3.110.0140.00314.60
7.3.100.0040.00715.08
7.3.90.0070.00715.14
7.3.80.0040.01115.00
7.3.70.0000.01014.92
7.3.60.0000.01614.79
7.3.50.0040.01114.86
7.3.40.0030.01514.85
7.3.30.0070.00715.01
7.3.20.0090.00616.64
7.3.10.0110.00316.50
7.3.00.0070.00316.77
7.2.330.0120.00616.88
7.2.320.0140.00716.81
7.2.310.0090.00816.95
7.2.300.0110.01116.87
7.2.290.0130.00316.53
7.2.250.0100.00715.26
7.2.240.0130.00714.98
7.2.230.0000.00915.10
7.2.220.0100.00315.16
7.2.210.0040.00814.88
7.2.200.0110.00414.95
7.2.190.0030.01615.04
7.2.180.0000.01514.98
7.2.170.0060.01014.88
7.2.00.0070.00719.41
7.1.330.0070.00715.91
7.1.320.0030.01215.79
7.1.310.0000.01415.78
7.1.300.0000.01516.03
7.1.290.0080.00315.93
7.1.280.0040.01115.94
7.1.270.0070.00715.85
7.1.260.0040.01115.93
7.1.100.0030.01018.46
7.1.70.0000.00717.22
7.1.60.0080.01519.08
7.1.50.0040.01416.78
7.1.00.0000.03722.57
7.0.200.0000.01017.00
7.0.140.0070.06322.09
7.0.100.0070.07720.15
7.0.90.0100.06020.12
7.0.80.0030.08720.11
7.0.70.0100.08320.11
7.0.60.0200.07320.04
7.0.50.0070.08020.53
7.0.40.0100.06720.16
7.0.30.0130.07720.31
7.0.20.0100.08020.29
7.0.10.0070.08320.15
7.0.00.0030.08720.21
5.6.280.0200.06021.19
5.6.250.0100.05020.74
5.6.240.0100.08020.80
5.6.230.0100.07020.80
5.6.220.0070.06720.75
5.6.210.0030.06720.64
5.6.200.0100.08321.17
5.6.190.0070.05021.16
5.6.180.0100.07721.11
5.6.170.0130.09021.13
5.6.160.0070.07721.22
5.6.150.0030.07021.20
5.6.140.0130.07321.24
5.6.130.0100.05021.20
5.6.120.0200.07321.19
5.6.110.0100.07721.15
5.6.100.0070.07321.18
5.6.90.0030.08721.14
5.6.80.0130.07320.61
5.6.70.0100.07720.63
5.6.60.0100.04720.48
5.6.50.0070.08020.63
5.6.40.0170.07020.70
5.6.30.0070.08320.54
5.6.20.0100.07020.68
5.6.10.0130.07720.65
5.6.00.0100.07720.57
5.5.380.0070.08020.52
5.5.370.0070.07720.55
5.5.360.0000.09020.53
5.5.350.0130.07720.54
5.5.340.0170.07321.09
5.5.330.0100.07720.88
5.5.320.0070.08320.96
5.5.310.0100.07320.91
5.5.300.0030.08021.11
5.5.290.0070.06321.09
5.5.280.0070.07721.00
5.5.270.0130.07020.91
5.5.260.0030.08720.89
5.5.250.0030.07720.70
5.5.240.0100.07720.36
5.5.230.0130.08020.18
5.5.220.0130.07320.37
5.5.210.0100.08020.32
5.5.200.0070.04720.46
5.5.190.0100.06720.25
5.5.180.0130.07320.42
5.5.160.0000.08020.41
5.5.150.0030.05720.29
5.5.140.0100.07020.41
5.5.130.0130.07020.45
5.5.120.0130.06720.25
5.5.110.0070.08020.26
5.5.100.0070.08020.17
5.5.90.0130.07020.25
5.5.80.0030.08020.19
5.5.70.0030.07720.31
5.5.60.0070.07320.20
5.5.50.0070.07720.18
5.5.40.0100.07320.29
5.5.30.0070.08320.10
5.5.20.0070.07720.13
5.5.10.0130.07020.15
5.5.00.0130.07320.23
5.4.450.0000.05019.62
5.4.440.0070.08319.43
5.4.430.0100.07319.50
5.4.420.0230.06319.58
5.4.410.0070.08319.48
5.4.400.0070.08319.44
5.4.390.0130.07019.29
5.4.380.0070.07019.18
5.4.370.0130.07319.28
5.4.360.0070.07719.24
5.4.350.0100.07319.27
5.4.340.0030.08019.25
5.4.320.0130.06719.26
5.4.310.0030.08019.23
5.4.300.0070.07719.27
5.4.290.0030.07719.25
5.4.280.0130.07319.09
5.4.270.0030.04719.28
5.4.260.0130.07718.98
5.4.250.0170.05719.22
5.4.240.0200.05719.07
5.4.230.0200.06019.01
5.4.220.0030.08019.11
5.4.210.0030.07319.01
5.4.200.0230.05719.21
5.4.190.0100.07319.22
5.4.180.0170.06719.29
5.4.170.0100.07019.18
5.4.160.0030.07719.08
5.4.150.0100.07319.22
5.4.140.0100.07016.41
5.4.130.0070.06316.22
5.4.120.0100.07016.52
5.4.110.0100.07016.61
5.4.100.0070.07016.53
5.4.90.0070.07016.52
5.4.80.0130.07016.55
5.4.70.0100.07716.50
5.4.60.0030.07716.46
5.4.50.0100.07016.49
5.4.40.0100.07016.50
5.4.30.0100.06716.46
5.4.20.0030.07316.65
5.4.10.0070.07016.40
5.4.00.0000.07716.06
5.3.290.0170.06314.68
5.3.280.0070.07314.77
5.3.270.0000.07014.73
5.3.260.0100.04314.80
5.3.250.0100.06714.65
5.3.240.0130.06314.74
5.3.230.0030.08014.79
5.3.220.0100.07314.73
5.3.210.0070.04314.76
5.3.200.0170.06714.67
5.3.190.0100.07014.59
5.3.180.0130.06014.70
5.3.170.0130.07014.66
5.3.160.0030.07314.59
5.3.150.0170.07014.68
5.3.140.0100.04014.74
5.3.130.0100.03014.75
5.3.120.0170.03014.57
5.3.110.0070.06714.55
5.3.100.0100.06714.21
5.3.90.0100.07314.22
5.3.80.0030.07014.23
5.3.70.0000.07714.14
5.3.60.0030.07314.21
5.3.50.0030.04714.01
5.3.40.0070.07713.94
5.3.30.0100.07013.90
5.3.20.0030.06713.82
5.3.10.0030.07313.77
5.3.00.0170.05713.65
5.2.170.0070.05011.59
5.2.160.0030.06311.59
5.2.150.0030.04311.59
5.2.140.0000.06011.59
5.2.130.0000.03311.59
5.2.120.0070.05711.59
5.2.110.0100.05311.59
5.2.100.0030.06311.59
5.2.90.0100.05311.59
5.2.80.0030.05711.59
5.2.70.0130.05311.59
5.2.60.0070.06011.59
5.2.50.0000.04711.59
5.2.40.0100.03011.59
5.2.30.0030.06711.59
5.2.20.0070.05711.59
5.2.10.0030.04311.59
5.2.00.0000.06311.59
5.1.60.0070.04711.59
5.1.50.0030.03711.59
5.1.40.0070.04011.59
5.1.30.0030.04711.59
5.1.20.0070.02711.59
5.1.10.0070.02711.59
5.1.00.0030.03311.59
5.0.50.0000.03711.59
5.0.40.0070.03711.59
5.0.30.0070.02711.59
5.0.20.0030.01711.59
5.0.10.0030.02011.59
5.0.00.0000.03311.59
4.4.90.0030.03711.59
4.4.80.0000.03711.59
4.4.70.0030.03711.59
4.4.60.0030.03711.59
4.4.50.0000.04011.59
4.4.40.0030.05011.59
4.4.30.0030.03311.59
4.4.20.0030.01311.59
4.4.10.0030.03711.59
4.4.00.0000.05311.59
4.3.110.0000.02711.59
4.3.100.0000.01711.59
4.3.90.0030.01311.59
4.3.80.0070.03011.59
4.3.70.0000.02711.59
4.3.60.0000.01711.59
4.3.50.0000.02011.59
4.3.40.0000.03011.59
4.3.30.0000.01711.59
4.3.20.0000.01711.59
4.3.10.0000.01711.59
4.3.00.0000.01311.59

preferences:
55.84 ms | 401 KiB | 5 Q