3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '<p height="200px;"> <img alt="Fahrrad Alt-Tag" src="http://localhost/mediafiles/Bilder/diamant-e-bike.jpg" height="250px" style="float: left; width: 300px; height: 189px; margin-left: 10px; margin-right: 10px;"> <br> <div style="height:200px;"> <img alt="Fahrrad Alt-Tag" src="http://localhost/mediafiles/Bilder/diamant-e-bike.jpg" height="250px" style="float: left; width: 300px; height: 189px; margin-left: 10px; margin-right: 10px;" class="google"> </div>'; function e24_img_responsive($html) { /* preg_match_all("~<img\s*(?:style\s*\=\s*[\'\"](.*?)[\'\"].*?\s*|class\s*\=\s*[\'\"](.*?)[\'\"].*?\s*|src\s*\=\s*[\'\"](.*?)[\'\"].*?\s*|alt\s*\=\s*[\'\"](.*?)[\'\"].*?\s*|width\s*\=\s*[\'\"](.*?)[\'\"].*?\s*|height\s*\=\s*[\'\"](.*?)[\'\"].*?\s*)+.*?>~", $html, $aImageTags); foreach($aImageTags[0] as $index => $string) { $new_string = $string; // style tag found if(!empty($aImageTags[1][$index])) { $new_string = preg_replace("~height:.*;~") } // class tag found if(!empty($aImageTags[2][$index])) { var_dump($aImageTags[2][$index]); } // height tag found if(!empty($aImageTags[6][$index])) { var_dump($aImageTags[6][$index]); } } */ $dom = new DOMDocument(); $dom->loadHTML($html); $images = $dom->getElementsByTagName(('img'); while($img = $images->item($i++)) { foreach($img->attributes as $attr) { echo $attr->name . " " . $attr->value . "<br />"; } } } e24_img_responsive($str); ?>

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)
7.1.40.0130.01734.12
7.1.30.0230.01334.01
7.1.20.0200.01334.40
7.1.10.0030.01016.35
7.1.00.0000.01016.52
7.0.180.0100.00715.92
7.0.170.0100.00715.98
7.0.160.0030.01315.87
7.0.150.0000.01015.96
7.0.140.0100.00316.05
7.0.130.0070.01016.28
7.0.120.0030.00716.43
7.0.110.0070.01316.05
7.0.100.0000.01716.04
7.0.90.0070.01015.83
7.0.80.0030.01316.24
7.0.70.0000.01716.18
7.0.60.0070.01015.92
7.0.50.0000.01316.16
7.0.40.0100.00716.29
7.0.30.0100.01016.16
7.0.20.0070.00716.21
7.0.10.0030.01016.21
7.0.00.0070.00716.14

preferences:
141.5 ms | 1394 KiB | 7 Q