3v4l.org

run code in 500+ PHP versions simultaneously
<?php $content = <<<DATA <body> <div class="entry-content"> <p><img src="https://picsum.photos/200/300" alt="" width="3264" height="2448" class="alignleft size-full wp-image-24" srcset="http://localhost/wp/wp-content/uploads/2018/08/image-1356510220.jpg 3264w, http://localhost/wp/wp-content/uploads/2018/08/image-1356510220-300x225.jpg 300w, http://localhost/wp/wp-content/uploads/2018/08/image-1356510220-768x576.jpg 768w, http://localhost/wp/wp-content/uploads/2018/08/image-1356510220-1024x768.jpg 1024w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></p> <p>Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet</p> <p><img src="https://picsum.photos/200/300" alt="" width="3264" height="2448" class="alignleft size-full wp-image-24" srcset="http://localhost/wp/wp-content/uploads/2018/08/image-1356510220.jpg 3264w, http://localhost/wp/wp-content/uploads/2018/08/image-1356510220-300x225.jpg 300w, http://localhost/wp/wp-content/uploads/2018/08/image-1356510220-768x576.jpg 768w, http://localhost/wp/wp-content/uploads/2018/08/image-1356510220-1024x768.jpg 1024w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></p> </div> </body> DATA; libxml_use_internal_errors(true); $dom = new DOMDocument('1.0', 'UTF-8'); $dom->loadHTML($content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $keyword = "HELLO"; $images = $dom->getElementsByTagName('img'); foreach ( $images as $image) { if (empty($image->getAttribute("alt"))) { $image->setAttribute('alt', $keyword); } } $content = $dom->saveHTML(); return $content;

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.5.30.0060.01121.48
8.5.20.0120.00719.88
8.5.10.0090.01016.92
8.5.00.0130.00920.31
8.4.180.0120.01122.17
8.4.170.0140.00924.09
8.4.160.0090.01325.87
8.4.150.0080.00517.00
8.4.140.0120.00917.70
8.4.130.0110.01018.20
8.4.120.0060.00321.01
8.4.110.0130.00722.65
8.4.100.0150.00317.96
8.4.90.0140.00819.21
8.4.80.0050.00418.26
8.4.70.0070.00218.13
8.4.60.0150.00520.55
8.4.50.0070.00417.88
8.4.40.0090.00917.87
8.4.30.0130.00717.94
8.4.20.0210.00018.79
8.4.10.0100.00717.91
8.3.300.0130.00721.01
8.3.290.0130.00821.16
8.3.280.0130.00818.55
8.3.270.0150.00616.79
8.3.260.0130.00616.99
8.3.250.0150.00519.18
8.3.240.0090.01117.05
8.3.230.0120.00816.72
8.3.220.0060.00417.50
8.3.210.0090.00616.86
8.3.200.0040.00516.81
8.3.190.0100.00617.57
8.3.180.0090.00516.88
8.3.170.0140.00419.19
8.3.160.0120.00616.98
8.3.150.0110.00720.91
8.3.140.0030.00616.86
8.3.130.0030.00618.67
8.3.120.0030.00619.34
8.3.110.0120.00620.94
8.3.100.0040.00424.06
8.3.90.0050.00326.77
8.3.80.0060.00318.68
8.3.70.0170.00716.91
8.3.60.0080.00818.56
8.3.50.0090.00817.37
8.3.40.0130.00319.04
8.3.30.0070.01018.92
8.3.20.0170.00318.94
8.3.10.0060.00322.20
8.3.00.0130.00622.25
8.2.300.0110.01218.37
8.2.290.0090.00920.84
8.2.280.0090.00920.64
8.2.270.0070.01117.34
8.2.260.0100.00720.37
8.2.250.0040.00416.84
8.2.240.0040.00419.41
8.2.230.0060.00322.58
8.2.220.0070.00337.54
8.2.210.0080.00026.77
8.2.200.0090.00018.66
8.2.190.0110.01118.83
8.2.180.0310.00616.75
8.2.170.0160.00622.96
8.2.160.0100.01019.25
8.2.150.0120.00624.18
8.2.140.0060.00624.66
8.2.130.0090.00922.38
8.2.120.0060.00326.35
8.2.110.0070.00322.55
8.2.100.0060.00618.13
8.2.90.0040.00418.34
8.2.80.0080.00020.48
8.2.70.0040.00418.30
8.2.60.0030.00718.34
8.2.50.0060.00318.10
8.2.40.0000.00919.73
8.2.30.0000.00721.08
8.2.20.0000.00818.26
8.2.10.0000.00818.41
8.2.00.0040.00419.89
8.1.340.0130.00721.84
8.1.330.0060.01321.92
8.1.320.0090.01116.52
8.1.310.0110.00417.12
8.1.300.0090.00017.88
8.1.290.0060.00318.88
8.1.280.0090.00625.92
8.1.270.0090.00922.32
8.1.260.0070.01126.35
8.1.250.0100.01028.09
8.1.240.0030.00624.09
8.1.230.0120.00020.95
8.1.220.0050.00318.02
8.1.210.0050.00318.91
8.1.200.0080.00017.60
8.1.190.0000.00817.66
8.1.180.0080.00018.10
8.1.170.0030.00618.93
8.1.160.0000.00719.21
8.1.150.0080.00019.13
8.1.140.0030.00519.26
8.1.130.0040.00420.36
8.1.120.0000.00817.72
8.1.110.0030.00617.70
8.1.100.0040.00417.68
8.1.90.0000.00717.73
8.1.80.0080.00017.71
8.1.70.0000.00917.67
8.1.60.0050.00317.93
8.1.50.0090.00017.81
8.1.40.0060.00317.76
8.1.30.0000.00817.88
8.1.20.0050.00317.94
8.1.10.0030.00617.88
8.1.00.0040.00417.79
8.0.300.0000.00820.46
8.0.290.0060.00316.75
8.0.280.0070.00018.57
8.0.270.0000.00717.62
8.0.260.0070.00018.58
8.0.250.0070.00017.21
8.0.240.0050.00317.25
8.0.230.0080.00017.16
8.0.220.0040.00417.22
8.0.210.0040.00417.16
8.0.200.0030.00317.21
8.0.190.0030.00617.29
8.0.180.0030.00517.20
8.0.170.0030.00617.21
8.0.160.0050.01017.15
8.0.150.0080.00017.07
8.0.140.0000.00717.12
8.0.130.0030.00313.67
8.0.120.0000.00717.16
8.0.110.0000.00817.18
8.0.100.0060.00317.27
8.0.90.0000.00817.29
8.0.80.0080.00917.25
8.0.70.0080.00017.07
8.0.60.0000.00817.03
8.0.50.0050.00317.13
8.0.30.0070.01117.37
8.0.20.0090.01417.55
8.0.10.0080.00017.44
8.0.00.0060.01217.21
7.4.330.0000.00515.55
7.4.320.0030.00316.83
7.4.300.0040.00416.86
7.4.290.0030.00316.83
7.4.280.0070.00316.72
7.4.270.0040.00416.82
7.4.260.0040.00416.68
7.4.250.0000.00816.80
7.4.240.0070.00016.94
7.4.230.0080.00016.50
7.4.220.0000.00816.87
7.4.210.0110.00516.86
7.4.200.0040.00416.68
7.4.160.0090.00916.86
7.4.140.0120.00817.86
7.4.130.0110.00716.72
7.4.120.0090.01116.73
7.4.110.0060.01616.80
7.4.100.0060.01516.95
7.4.90.0090.00916.74
7.4.80.0120.00919.39
7.4.70.0070.01016.67
7.4.60.0130.00916.92
7.4.50.0060.00616.85
7.4.40.0090.01516.63
7.4.00.0070.01014.89
7.3.330.0030.00313.42
7.3.320.0000.00513.32
7.3.310.0030.00316.44
7.3.300.0070.00016.46
7.3.290.0050.00416.52
7.3.280.0120.00816.57
7.3.260.0150.00516.70
7.3.240.0110.00716.65
7.3.230.0100.01016.86
7.3.210.0070.01416.88
7.3.200.0120.00416.82
7.3.190.0040.01816.88
7.3.180.0070.01016.66
7.3.170.0070.01016.72
7.3.160.0140.00316.54
7.2.330.0160.00316.91
7.2.320.0110.01116.87
7.2.310.0080.00916.92
7.2.300.0130.00316.88
7.2.290.0120.00616.97
7.2.100.0690.00714.95
7.2.90.3950.01314.85
7.2.80.3350.01014.74
7.2.70.3260.00314.94
7.2.60.3070.00615.18
7.2.50.4880.01714.85
7.2.40.2710.01014.78
7.2.30.3520.00315.11
7.2.20.3300.00714.82
7.2.10.0110.00815.05
7.2.00.4000.00614.93
7.1.210.4370.00713.61
7.1.200.3480.01013.84
7.1.190.3270.01013.82
7.1.180.3750.00013.67
7.1.170.2170.00013.70
7.1.160.0040.01313.76
7.1.150.4350.00713.87
7.1.140.0110.00713.76
7.1.130.0130.00413.88
7.1.120.3510.00313.87
7.1.110.4200.00013.82
7.1.100.3290.00713.71
7.1.90.1240.00014.19
7.1.80.2080.00614.04
7.1.70.3500.00013.89
7.1.60.3350.01031.79
7.1.50.3850.00731.98
7.1.40.0380.01031.61
7.1.30.0380.00531.80
7.1.20.3280.00731.89
7.1.10.3460.00913.91
7.1.00.3240.00013.96

preferences:
55.28 ms | 1411 KiB | 5 Q