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($string); $xml->registerXPathNamespace('svg', 'http://www.w3.org/2000/svg'); $xml->xpath('g/path')[0]->addAttribute('id', '12') $xml->xpath('g/path')[0]->asXML('php://output');

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)
5.4.200.0370.06719.19
5.4.190.0200.05319.21
5.4.180.0330.03719.30
5.4.170.0270.06718.98
5.4.160.0300.03318.85
5.4.150.0430.05718.96
5.4.140.0370.05316.34
5.4.130.0270.04716.35
5.4.120.0230.03716.32
5.4.110.0230.03316.58
5.4.100.0270.05316.45
5.4.90.0170.04016.27
5.4.80.0270.06716.43
5.4.70.0270.03716.55
5.4.60.0200.03316.54
5.4.50.0270.03016.38
5.4.40.0270.06316.55
5.4.30.0270.06016.42
5.4.20.0200.03716.24
5.4.10.0200.04316.33
5.4.00.0300.02715.94
5.3.270.0270.05714.63
5.3.260.0300.06714.48
5.3.250.0330.04314.70
5.3.240.0300.03714.55
5.3.230.0230.04714.62
5.3.220.0170.04314.44
5.3.210.0200.05014.41
5.3.200.0370.06014.40
5.3.190.0170.04014.60
5.3.180.0200.05014.55
5.3.170.0230.04014.52
5.3.160.0130.04314.51
5.3.150.0270.03014.40
5.3.140.0170.04314.50
5.3.130.0230.03314.41
5.3.120.0170.04014.40
5.3.110.0200.03714.41
5.3.100.0170.04014.02
5.3.90.0230.03314.07
5.3.80.0170.03713.86
5.3.70.0330.02314.12
5.3.60.0270.02713.91
5.3.50.0230.03013.78
5.3.40.0170.04014.04
5.3.30.0300.06713.86
5.3.20.0300.06313.52
5.3.10.0200.03313.61
5.3.00.0270.06713.55

preferences:
138.49 ms | 1394 KiB | 7 Q