3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_POST['content'] = '<path d="m34.511 143.4v3.0302l54.101-0.63086v-2.078z" points="34.510773,146.42924 88.611514,145.79838 88.611514,143.72037 34.510773,143.39908" fill="#353564"/> <path d="m34.511 146.43 78.119 2.1017 56.193-2.4552-80.211-0.27738z" points="112.6299,148.53093 168.82266,146.07576 88.611514,145.79838 34.510773,146.42924" fill="#afafde"/>'; //first make the post content valid XML $xml = '<xmp>' . $_POST['content'] . '</xmp>'; //load it as a DOMDOcument to parse the desired tags of path $doc = new DOMDocument(); $doc->loadXML($xml); $array = []; //find all of the <path/> tags foreach($doc->getElementsByTagName('path') as $node) { $attributes = []; //convert the attributes into an associative array by attribute name foreach($node->attributes as $attribute) { $attributes[$attribute->name] = $attribute->value; } //store the tag and attributes into array $array[] = (object) [ $node->tagName => $attributes ]; } //convert the PHP array to a JSON string of an array of objects $json = json_encode($array, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT); print_r($json);

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.0050.00519.63
8.4.120.0100.00826.12
8.4.110.0130.00822.59
8.4.100.0140.00718.88
8.4.90.0160.00318.92
8.4.80.0110.00918.76
8.4.70.0090.00718.41
8.4.60.0130.00819.16
8.4.50.0090.01020.56
8.4.40.0160.00317.95
8.4.30.0130.01017.70
8.4.20.0090.00020.74
8.4.10.0030.00618.00
8.3.260.0100.01016.76
8.3.250.0110.00819.20
8.3.240.0100.00917.20
8.3.230.0030.00616.77
8.3.220.0130.00819.05
8.3.210.0040.00418.85
8.3.200.0030.00616.76
8.3.190.0090.00617.39
8.3.180.0090.00917.36
8.3.170.0120.00619.15
8.3.160.0070.01017.19
8.3.150.0130.01017.76
8.3.140.0030.00617.43
8.3.130.0040.00418.52
8.3.120.0040.00419.18
8.3.110.0030.00620.94
8.3.100.0060.00324.06
8.3.90.0090.00026.77
8.3.80.0000.01317.13
8.3.70.0120.00618.81
8.3.60.0040.01218.43
8.3.50.0100.00618.13
8.3.40.0150.00019.05
8.3.30.0030.01318.92
8.3.20.0050.00319.48
8.3.10.0080.00023.78
8.3.00.0000.00822.68
8.2.290.0110.00920.56
8.2.280.0060.00318.74
8.2.270.0090.00917.20
8.2.260.0090.00618.52
8.2.250.0000.00818.90
8.2.240.0000.00817.32
8.2.230.0040.00422.58
8.2.220.0080.00037.54
8.2.210.0120.00326.77
8.2.200.0060.00317.13
8.2.190.0110.01116.88
8.2.180.0110.00425.92
8.2.170.0070.01419.25
8.2.160.0070.00722.96
8.2.150.0030.00525.66
8.2.140.0030.00524.66
8.2.130.0050.00326.16
8.2.120.0000.00818.90
8.2.110.0070.00422.17
8.2.100.0120.00018.41
8.2.90.0050.00317.86
8.2.80.0030.00518.98
8.2.70.0050.00317.75
8.2.60.0040.00418.47
8.2.50.0040.00418.10
8.2.40.0040.00421.40
8.2.30.0040.00420.85
8.2.20.0040.00418.54
8.2.10.0050.00318.39
8.2.00.0000.00819.71
8.1.330.0050.00422.38
8.1.320.0100.00616.64
8.1.310.0090.00618.47
8.1.300.0070.01118.88
8.1.290.0030.00630.84
8.1.280.0040.01425.92
8.1.270.0050.00224.66
8.1.260.0060.00326.35
8.1.250.0030.00628.09
8.1.240.0090.00022.72
8.1.230.0040.00719.34
8.1.220.0080.00018.84
8.1.210.0040.00418.77
8.1.200.0050.00317.47
8.1.190.0000.00917.48
8.1.180.0070.00318.10
8.1.170.0030.00519.15
8.1.160.0040.00419.03
8.1.150.0060.00619.12
8.1.140.0030.00519.18
8.1.130.0030.00319.19
8.1.120.0000.00717.73
8.1.110.0050.00317.72
8.1.100.0000.00717.76
8.1.90.0070.00017.76
8.1.80.0040.00417.63
8.1.70.0070.00017.59
8.1.60.0060.00317.87
8.1.50.0040.00717.68
8.1.40.0000.00817.72
8.1.30.0030.00617.83
8.1.20.0040.00417.95
8.1.10.0030.00617.84
8.1.00.0000.00817.81
8.0.300.0030.00518.77
8.0.290.0070.00016.88
8.0.280.0000.00718.66
8.0.270.0040.00417.36
8.0.260.0030.00317.36
8.0.250.0070.00017.08
8.0.240.0070.00017.08
8.0.230.0000.00717.26
8.0.220.0000.00717.18
8.0.210.0000.00717.20
8.0.200.0030.00317.21
8.0.190.0050.00217.02
8.0.180.0050.00217.02
8.0.170.0060.00317.02
8.0.160.0020.00517.07
8.0.150.0030.00617.14
8.0.140.0000.00817.04
8.0.130.0000.00513.58
8.0.120.0040.00416.97
8.0.110.0030.00517.14
8.0.100.0040.00417.17
8.0.90.0040.00417.04
8.0.80.0140.00617.15
8.0.70.0050.00216.91
8.0.60.0040.00417.16
8.0.50.0000.00716.95
8.0.30.0060.01217.33
8.0.20.0140.00717.40
8.0.10.0030.00317.06
8.0.00.0090.00816.82
7.4.330.0050.00015.55
7.4.320.0030.00516.74
7.4.300.0030.00316.77
7.4.290.0040.00416.82
7.4.280.0000.00716.91
7.4.270.0030.00316.70
7.4.260.0030.00316.80
7.4.250.0030.00316.61
7.4.240.0030.00316.77
7.4.230.0030.00316.78
7.4.220.0050.00316.84
7.4.210.0040.00916.76
7.4.200.0000.00716.51
7.4.160.0120.00616.77
7.4.140.0100.01017.86
7.4.130.0120.00616.79
7.4.120.0100.00916.72
7.4.110.0030.01316.82
7.4.100.0160.01016.89
7.4.90.0140.00316.70
7.4.80.0070.01019.39
7.4.70.0050.01216.81
7.4.60.0090.01216.72
7.4.50.0030.01316.63
7.4.40.0030.01416.61
7.4.00.0080.00314.75
7.3.330.0040.00413.31
7.3.320.0030.00313.37
7.3.310.0040.00416.62
7.3.300.0030.00316.40
7.3.290.0000.00716.35
7.3.280.0100.00416.49
7.3.260.0100.00916.60
7.3.240.0100.00916.55
7.3.230.0070.01016.68
7.3.210.0100.00716.76
7.3.200.0100.00716.77
7.3.190.0070.01016.75
7.3.180.0100.00716.66
7.3.170.0060.00916.84
7.3.160.0080.00816.64
7.2.330.0090.00916.71
7.2.320.0110.00717.10
7.2.310.0100.00717.09
7.2.300.0090.00916.75
7.2.290.0040.01417.15
7.2.110.0090.00416.81
7.2.80.1070.00314.75
7.2.70.1670.00315.25
7.2.60.1740.00615.04
7.2.50.1220.00315.07
7.2.40.0770.01315.08
7.2.30.0890.01015.21
7.2.20.0750.01015.23
7.2.10.0860.00315.12
7.2.00.0800.01315.41
7.1.200.1460.00314.18
7.1.190.0860.01014.07
7.1.180.1570.01013.96
7.1.170.1000.00714.01
7.1.160.0920.01313.68
7.1.150.1430.01013.86
7.1.140.0730.01013.93
7.1.130.1020.01613.86
7.1.120.1410.00613.82
7.1.110.1310.01014.03
7.1.100.1370.00714.03
7.1.90.0840.01014.12
7.1.80.1130.00713.81
7.1.70.1390.00313.94
7.1.60.1730.01332.04
7.1.50.1750.00731.64
7.1.40.2290.01032.04
7.1.30.2630.00731.90
7.1.20.2810.01131.76
7.1.10.1890.01013.71
7.1.00.2020.01314.05

preferences:
27.43 ms | 403 KiB | 5 Q