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'); $sxe->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.60.0150.00618.53
8.3.50.0190.01022.05
8.3.40.0120.00319.34
8.3.30.0000.01519.16
8.3.20.0040.00419.07
8.3.10.0000.00821.38
8.3.00.0040.00423.91
8.2.180.0090.00617.13
8.2.170.0110.00422.96
8.2.160.0100.00320.77
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0070.00021.18
8.2.110.0030.00620.84
8.2.100.0090.00318.04
8.2.90.0040.00418.34
8.2.80.0000.00719.71
8.2.70.0040.00417.88
8.2.60.0000.00818.18
8.2.50.0040.00418.07
8.2.40.0050.00318.59
8.2.30.0050.00219.81
8.2.20.0000.00917.86
8.2.10.0000.00818.12
8.2.00.0070.00317.88
8.1.280.0120.00825.92
8.1.270.0040.00423.99
8.1.260.0070.01126.35
8.1.250.0050.00228.09
8.1.240.0060.00322.47
8.1.230.0110.00023.04
8.1.220.0040.00418.04
8.1.210.0000.01318.92
8.1.200.0060.00317.60
8.1.190.0040.00417.79
8.1.180.0040.00418.10
8.1.170.0060.00318.84
8.1.160.0030.00619.21
8.1.150.0000.00718.86
8.1.140.0000.00817.57
8.1.130.0030.00318.06
8.1.120.0000.00717.82
8.1.110.0000.00717.81
8.1.100.0050.00317.83
8.1.90.0000.00717.81
8.1.80.0040.00417.58
8.1.70.0000.00817.71
8.1.60.0030.00617.92
8.1.50.0040.00417.61
8.1.40.0030.00517.69
8.1.30.0050.00218.05
8.1.20.0030.00517.86
8.1.10.0000.00817.78
8.1.00.0000.00817.64
8.0.300.0000.00720.34
8.0.290.0050.00217.40
8.0.280.0070.00018.70
8.0.270.0000.00717.57
8.0.260.0030.00317.25
8.0.250.0000.00817.27
8.0.240.0030.00717.12
8.0.230.0040.00417.30
8.0.220.0050.00517.30
8.0.210.0000.00717.25
8.0.200.0040.00417.16
8.0.190.0030.00617.19
8.0.180.0020.00517.34
8.0.170.0000.00917.23
8.0.160.0000.00717.13
8.0.150.0050.00216.98
8.0.140.0000.00717.26
8.0.130.0030.00313.70
8.0.120.0030.00517.00
8.0.110.0050.00217.29
8.0.100.0050.00217.03
8.0.90.0000.00817.15
8.0.80.0110.00417.22
8.0.70.0040.00417.07
8.0.60.0040.00417.03
8.0.50.0040.00417.18
8.0.30.0070.01617.52
8.0.20.0130.00617.40
8.0.10.0030.00517.21
8.0.00.0140.00916.91
7.4.330.0020.00217.04
7.4.320.0060.00016.73
7.4.300.0000.00616.84
7.4.290.0000.00616.76
7.4.280.0000.00716.90
7.4.270.0000.00716.82
7.4.260.0070.00013.49
7.4.250.0060.00316.71
7.4.240.0040.00416.80
7.4.230.0070.00016.81
7.4.220.0120.00616.77
7.4.210.0100.00616.89
7.4.200.0070.00016.75
7.4.190.0000.00816.81
7.4.160.0080.00816.84
7.4.150.0120.00617.40
7.4.140.0100.01217.86
7.4.130.0150.00516.79
7.4.120.0120.00416.82
7.4.110.0070.01016.87
7.4.100.0120.00816.93
7.4.90.0140.00416.80
7.4.80.0070.01919.39
7.4.70.0070.01016.69
7.4.60.0040.01416.83
7.4.50.0040.00416.58
7.4.40.0130.00322.77
7.4.30.0090.00916.81
7.4.00.0040.01115.18
7.3.330.0070.00013.25
7.3.320.0060.00013.36
7.3.310.0070.00016.36
7.3.300.0030.00316.52
7.3.290.0040.01016.62
7.3.280.0100.01016.59
7.3.270.0120.00917.40
7.3.260.0100.01118.24
7.3.250.0090.00816.75
7.3.240.0100.00716.55
7.3.230.0070.01117.00
7.3.210.0110.00516.76
7.3.200.0110.01119.39
7.3.190.0140.00416.53
7.3.180.0030.01416.65
7.3.170.0100.01016.85
7.3.160.0050.01116.71
7.3.120.0060.01014.96
7.2.330.0090.00916.93
7.2.320.0030.01717.13
7.2.310.0060.01516.80
7.2.300.0110.01016.93
7.2.290.0090.00616.65
7.2.60.0070.01016.89
7.2.00.0000.01019.69
7.1.200.0000.01415.81
7.1.70.0040.00417.03
7.1.60.0040.00717.32
7.1.50.0040.01817.14
7.1.00.0030.04722.57
7.0.200.0100.00616.88
7.0.140.0000.07722.29
7.0.100.0030.05020.12
7.0.90.0100.04320.26
7.0.80.0170.06720.07
7.0.70.0070.04020.02
7.0.60.0430.07020.10
7.0.50.0170.07720.47
7.0.40.0130.04020.35
7.0.30.0070.08320.22
7.0.20.0130.07720.25
7.0.10.0130.07720.22
7.0.00.0100.07020.34
5.6.280.0030.07321.00
5.6.250.0200.06721.02
5.6.240.0130.08020.71
5.6.230.0100.05320.89
5.6.220.0100.08020.95
5.6.210.0070.04720.82
5.6.200.0200.08021.23
5.6.190.0070.07321.14
5.6.180.0300.05721.34
5.6.170.0100.07321.21
5.6.160.0130.07321.21
5.6.150.0070.04021.13
5.6.140.0170.08021.21
5.6.130.0030.07721.12
5.6.120.0030.08721.18
5.6.110.0070.08021.18
5.6.100.0130.04321.14
5.6.90.0170.07721.22
5.6.80.0100.03320.68
5.6.70.0100.04720.57
5.6.60.0170.06020.57
5.6.50.0030.05020.57
5.6.40.0100.08020.57
5.6.30.0070.06020.55
5.6.20.0070.04320.55
5.6.10.0100.04320.49
5.6.00.0030.06020.54
5.5.380.0100.05020.65
5.5.370.0070.04720.68
5.5.360.0070.08320.51
5.5.350.0070.04720.55
5.5.340.0070.07720.98
5.5.330.0130.06721.07
5.5.320.0070.08021.06
5.5.310.0030.04320.99
5.5.300.0030.05020.98
5.5.290.0130.06721.07
5.5.280.0030.05720.91
5.5.270.0070.08320.91
5.5.260.0070.04721.06
5.5.250.0030.05020.90
5.5.240.0100.03320.38
5.5.230.0030.08320.47
5.5.220.0100.04720.44
5.5.210.0200.06720.20
5.5.200.0130.06720.46
5.5.190.0000.06320.30
5.5.180.0170.07020.41
5.5.160.0070.05320.17
5.5.150.0130.03320.43
5.5.140.0030.04320.42
5.5.130.0070.04020.44
5.5.120.0000.03720.34
5.5.110.0030.04020.43
5.5.100.0000.04320.16
5.5.90.0030.03720.29
5.5.80.0070.03020.27
5.5.70.0030.04320.20
5.5.60.0100.03320.31
5.5.50.0030.03320.18
5.5.40.0000.03320.27
5.5.30.0030.03720.25
5.5.20.0030.07320.30
5.5.10.0030.03720.13
5.5.00.0030.04020.14
5.4.450.0030.08719.62
5.4.440.0230.05319.41
5.4.430.0070.04319.31
5.4.420.0030.07719.55
5.4.410.0100.08019.28
5.4.400.0030.07719.25
5.4.390.0230.05319.02
5.4.380.0030.04719.23
5.4.370.0070.08019.17
5.4.360.0030.08718.99
5.4.350.0070.07719.29
5.4.340.0030.04019.01
5.4.320.0070.04019.23
5.4.310.0030.04319.02
5.4.300.0000.04019.26
5.4.290.0130.03319.43
5.4.280.0130.03019.23
5.4.270.0000.03719.28
5.4.260.0030.03719.43
5.4.250.0030.03719.18
5.4.240.0070.04019.27
5.4.230.0070.03319.18
5.4.220.0070.03319.23
5.4.210.0070.02719.08
5.4.200.0030.03719.26
5.4.190.0070.03719.20
5.4.180.0000.03319.24
5.4.170.0030.04019.31
5.4.160.0070.04319.15
5.4.150.0030.05319.26
5.4.140.0100.03016.59
5.4.130.0030.03016.32
5.4.120.0030.03016.59
5.4.110.0030.03016.43
5.4.100.0070.02716.58
5.4.90.0030.04316.69
5.4.80.0070.04716.60
5.4.70.0000.03316.56
5.4.60.0030.03716.47
5.4.50.0000.03316.61
5.4.40.0100.02316.55
5.4.30.0000.03716.33
5.4.20.0070.03016.57
5.4.10.0000.04016.37
5.4.00.0100.03715.96
5.3.290.0030.04014.77
5.3.280.0130.02714.78
5.3.270.0000.03714.61
5.3.260.0000.03714.60
5.3.250.0000.03714.77
5.3.240.0100.03314.72
5.3.230.0000.03714.73
5.3.220.0170.02714.71
5.3.210.0030.03014.70
5.3.200.0070.03314.71
5.3.190.0070.03014.77
5.3.180.0000.03314.66
5.3.170.0000.04014.74
5.3.160.0000.04014.70
5.3.150.0030.03714.73
5.3.140.0000.04014.69
5.3.130.0070.03014.70
5.3.120.0000.04014.74
5.3.110.0070.03314.61
5.3.100.0070.04014.09
5.3.90.0030.03314.04
5.3.80.0100.02714.12
5.3.70.0000.04014.13
5.3.60.0070.03013.96
5.3.50.0070.03014.12
5.3.40.0000.03314.09
5.3.30.0000.03714.01
5.3.20.0100.04713.69
5.3.10.0000.03013.82
5.3.00.0030.03313.63
5.2.170.0030.02311.30
5.2.160.0070.02011.30
5.2.150.0030.02711.39
5.2.140.0000.02711.16
5.2.130.0000.03011.34
5.2.120.0000.02711.34
5.2.110.0100.01711.36
5.2.100.0030.02711.13
5.2.90.0030.05011.14
5.2.80.0030.06711.22
5.2.70.0000.03011.20
5.2.60.0000.06311.11
5.2.50.0030.05011.01
5.2.40.0100.06010.98
5.2.30.0030.04711.23
5.2.20.0030.06711.14
5.2.10.0000.06011.14
5.2.00.0100.05010.82
5.1.60.0070.03010.43
5.1.50.0070.03310.43
5.1.40.0130.04710.43
5.1.30.0070.05310.67
5.1.20.0030.05310.47
5.1.10.0030.06010.43
5.1.00.0070.05710.43
5.0.50.0000.04710.43
5.0.40.0000.04710.43
5.0.30.0070.05010.43
5.0.20.0030.03710.43
5.0.10.0000.04710.43
5.0.00.0070.03310.43
4.4.90.0030.01710.43
4.4.80.0000.03710.43
4.4.70.0030.03010.43
4.4.60.0000.03710.43
4.4.50.0000.03710.43
4.4.40.0070.05010.43
4.4.30.0000.02310.43
4.4.20.0030.02710.43
4.4.10.0030.03310.43
4.4.00.0070.05010.43
4.3.110.0000.03710.43
4.3.100.0000.04010.43
4.3.90.0030.03310.43
4.3.80.0000.03010.43
4.3.70.0030.02010.43
4.3.60.0000.03710.43
4.3.50.0070.01310.43
4.3.40.0000.05010.43
4.3.30.0070.03010.43
4.3.20.0000.04010.43
4.3.10.0000.02310.43
4.3.00.0000.01710.43

preferences:
44.85 ms | 401 KiB | 5 Q