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)
8.3.60.0110.00716.88
8.3.50.0110.01118.42
8.3.40.0090.00619.24
8.3.30.0150.00019.00
8.3.20.0040.00420.41
8.3.10.0080.00021.93
8.3.00.0000.00821.98
8.2.180.0110.00718.92
8.2.170.0140.00722.96
8.2.160.0100.00321.31
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0000.00720.64
8.2.120.0060.00326.35
8.2.110.0000.01122.51
8.2.100.0080.00318.16
8.2.90.0030.00519.26
8.2.80.0060.00317.97
8.2.70.0060.00317.88
8.2.60.0000.01018.04
8.2.50.0060.00318.16
8.2.40.0090.00022.44
8.2.30.0040.00421.24
8.2.20.0070.00018.49
8.2.10.0040.00418.39
8.2.00.0030.00618.43
8.1.280.0000.01525.92
8.1.270.0060.00320.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00624.05
8.1.230.0060.00617.97
8.1.220.0030.00518.01
8.1.210.0030.00518.77
8.1.200.0060.00317.47
8.1.190.0060.00317.75
8.1.180.0080.00018.10
8.1.170.0040.00420.36
8.1.160.0060.00319.14
8.1.150.0040.00422.15
8.1.140.0000.00719.76
8.1.130.0030.00319.24
8.1.120.0050.00317.65
8.1.110.0000.00817.68
8.1.100.0030.00517.67
8.1.90.0020.00517.57
8.1.80.0000.00717.61
8.1.70.0040.00417.63
8.1.60.0090.00017.77
8.1.50.0080.00017.61
8.1.40.0040.00417.77
8.1.30.0040.00417.75
8.1.20.0040.00417.92
8.1.10.0040.00417.78
8.1.00.0000.00817.70
8.0.300.0070.00018.77
8.0.290.0060.00316.88
8.0.280.0040.00418.66
8.0.270.0040.00417.51
8.0.260.0000.00717.48
8.0.250.0000.00817.13
8.0.240.0040.00417.21
8.0.230.0070.00017.29
8.0.220.0000.00717.18
8.0.210.0030.00317.09
8.0.200.0000.00717.25
8.0.190.0060.00317.14
8.0.180.0060.00317.18
8.0.170.0000.00717.11
8.0.160.0000.00817.25
8.0.150.0000.00717.14
8.0.140.0050.00217.16
8.0.130.0070.00013.59
8.0.120.0000.00717.07
8.0.110.0040.00417.12
8.0.100.0070.00017.18
8.0.90.0070.00017.32
8.0.80.0100.01017.13
8.0.70.0000.00717.17
8.0.60.0070.00017.04
8.0.50.0040.00417.30
8.0.30.0110.00717.39
8.0.20.0080.01017.40
8.0.10.0040.00417.15
8.0.00.0190.00017.02
7.4.330.0030.00315.55
7.4.320.0040.00416.66
7.4.300.0000.00616.82
7.4.290.0050.00216.73
7.4.280.0030.00616.71
7.4.270.0000.00716.66
7.4.260.0070.00016.86
7.4.250.0030.00316.69
7.4.240.0070.00016.63
7.4.230.0000.00716.79
7.4.220.0100.00616.82
7.4.210.0050.00916.97
7.4.200.0040.00416.56
7.4.160.0090.00716.77
7.4.150.0080.00917.40
7.4.140.0110.00717.86
7.4.130.0110.00616.75
7.4.120.0110.01016.79
7.4.110.0100.00716.79
7.4.100.0130.00916.79
7.4.90.0100.00716.58
7.4.80.0150.00919.39
7.4.70.0100.00616.63
7.4.60.0130.00316.61
7.4.50.0000.01416.89
7.4.40.0060.01216.88
7.4.30.0150.00716.48
7.4.00.0060.00915.06
7.3.330.0000.00613.45
7.3.320.0000.00513.26
7.3.310.0000.00616.56
7.3.300.0030.00316.46
7.3.290.0030.01116.56
7.3.280.0090.01016.53
7.3.270.0140.00317.40
7.3.260.0140.00716.68
7.3.250.0090.00816.57
7.3.240.0120.00816.72
7.3.230.0100.00716.65
7.3.210.0160.00016.54
7.3.200.0040.01416.66
7.3.190.0110.01216.64
7.3.180.0060.01016.59
7.3.170.0100.00616.57
7.3.160.0030.01316.50
7.3.120.0040.01514.65
7.3.110.0060.01314.75
7.3.100.0060.01014.91
7.3.90.0040.01215.06
7.3.80.0100.00314.98
7.3.70.0120.00314.83
7.3.60.0000.01414.95
7.3.50.0060.00614.80
7.3.40.0030.01415.01
7.3.30.0040.01114.77
7.3.20.0040.00916.73
7.3.10.0040.01116.85
7.3.00.0050.01116.54
7.2.330.0060.01217.02
7.2.320.0030.01317.08
7.2.310.0150.00316.71
7.2.300.0060.01016.81
7.2.290.0090.01516.74
7.2.250.0030.01715.32
7.2.240.0160.00615.09
7.2.230.0060.00615.36
7.2.220.0070.00715.06
7.2.210.0030.00915.23
7.2.200.0060.00614.87
7.2.190.0000.01415.23
7.2.180.0040.00815.29
7.2.170.0070.00315.30
7.2.130.0060.01017.05
7.2.120.0110.00416.96
7.2.110.0080.00816.92
7.2.100.0030.01017.12
7.2.90.0090.00617.11
7.2.80.0090.00617.16
7.2.70.0030.00616.93
7.2.60.0050.01117.11
7.2.50.0000.01516.99
7.2.40.0070.00716.86
7.2.30.0070.01016.78
7.2.20.0060.00916.73
7.2.10.0060.00616.97
7.2.00.0090.00418.22
7.1.330.0030.01016.00
7.1.320.0000.01416.10
7.1.310.0100.00715.99
7.1.300.0000.01315.66
7.1.290.0030.00615.93
7.1.280.0000.01416.09
7.1.270.0130.00315.65
7.1.260.0070.01116.04
7.1.250.0040.01415.63
7.1.240.0060.00615.68
7.1.230.0030.01015.58
7.1.220.0100.00315.58
7.1.210.0120.00015.79
7.1.200.0050.00615.65
7.1.190.0120.00015.99
7.1.180.0120.00015.79
7.1.170.0090.00615.92
7.1.160.0120.00315.89
7.1.150.0100.00315.84
7.1.140.0130.00315.80
7.1.130.0080.00815.95
7.1.120.0060.00615.89
7.1.110.0100.00315.92
7.1.100.0030.01015.89
7.1.90.0110.00316.07
7.1.80.0110.00315.86
7.1.70.0080.00516.43
7.1.60.0050.00716.63
7.1.50.0130.01025.37
7.1.40.0110.01224.94
7.1.30.0120.00725.25
7.1.20.0140.00725.35
7.1.10.0050.00916.27
7.1.00.0000.01316.22
7.0.330.0080.00815.40
7.0.320.0090.00915.41
7.0.310.0060.00615.74
7.0.300.0070.01015.52
7.0.290.0040.00815.34
7.0.280.0110.00015.53
7.0.270.0090.00915.55
7.0.260.0080.00815.49
7.0.250.0090.00315.63
7.0.240.0040.00815.65
7.0.230.0090.00615.39
7.0.220.0110.00415.63
7.0.210.0060.00615.39
7.0.200.0140.00616.09
7.0.190.0040.00815.72
7.0.180.0030.01215.79
7.0.170.0070.00515.85
7.0.160.0030.01015.95
7.0.150.0100.00515.79
7.0.140.0080.00716.01
7.0.130.0040.00916.16
7.0.120.0050.00715.94
7.0.110.0080.00815.83
7.0.100.0080.00815.89
7.0.90.0040.01015.91
7.0.80.0060.00615.92
7.0.70.0070.00816.01
7.0.60.0080.00815.95
7.0.50.0020.00915.96
7.0.40.0030.00814.86
7.0.30.0030.00815.11
7.0.20.0050.00715.08
7.0.10.0050.01014.98
7.0.00.0050.00914.87
5.6.380.0070.00314.85

preferences:
60.85 ms | 401 KiB | 5 Q