3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<a href="#"><img src="image1"></a>blabla<a href="#">Without an image</a><a href="#"><img src="image2"></a>'; $domDocument = new \DOMDocument(); $domDocument->loadHTML($html); $xpath = new DOMXPath($domDocument); foreach ($xpath->query('//a[./img]') as $imageLink) { echo $domDocument->saveHTML($imageLink), PHP_EOL; }

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.120.0110.00820.80
8.4.110.0150.00619.02
8.4.100.0100.01017.93
8.4.90.0120.00919.12
8.4.80.0160.00420.10
8.4.70.0140.00718.28
8.4.60.0060.00619.18
8.4.50.0160.00517.94
8.4.40.0160.00320.03
8.4.30.0120.00320.54
8.4.20.0000.00819.85
8.4.10.0060.00319.69
8.3.250.0110.00819.11
8.3.240.0140.00617.04
8.3.230.0080.00716.78
8.3.220.0140.00517.37
8.3.210.0110.00916.85
8.3.200.0070.01316.95
8.3.190.0080.01216.91
8.3.180.0050.00316.92
8.3.170.0150.00416.86
8.3.160.0110.00716.97
8.3.150.0100.01017.35
8.3.140.0140.00416.75
8.3.130.0070.00317.07
8.3.120.0070.01019.17
8.3.110.0150.00618.78
8.3.100.0030.00620.34
8.3.90.0180.00318.41
8.3.80.0060.00319.36
8.3.70.0120.00618.80
8.3.60.0090.00616.75
8.3.50.0160.01023.69
8.3.40.0120.00618.81
8.3.30.0060.01318.86
8.3.20.0070.00021.19
8.3.10.0000.00822.38
8.3.00.0040.00422.15
8.2.290.0130.00620.66
8.2.280.0040.00518.88
8.2.270.0180.00016.86
8.2.260.0120.00619.14
8.2.250.0080.00017.14
8.2.240.0060.00317.39
8.2.230.0100.01020.94
8.2.220.0050.00524.06
8.2.210.0090.00626.77
8.2.200.0040.00418.88
8.2.190.0110.00718.94
8.2.180.0090.01319.04
8.2.170.0120.00322.96
8.2.160.0070.00720.76
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0050.00226.16
8.2.110.0060.00321.25
8.2.100.0080.00418.09
8.2.90.0040.00418.16
8.2.80.0040.00419.36
8.2.70.0040.00418.41
8.2.60.0060.00318.41
8.2.50.0070.00019.64
8.2.40.0030.00619.72
8.2.30.0070.00019.53
8.2.20.0040.00418.31
8.2.10.0000.00819.67
8.2.00.0030.00619.75
8.1.330.0060.00322.07
8.1.320.0050.01416.37
8.1.310.0060.01216.92
8.1.300.0060.00318.30
8.1.290.0090.00030.84
8.1.280.0120.00925.92
8.1.270.0090.00621.25
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.57
8.1.230.0080.00321.39
8.1.220.0030.00518.16
8.1.210.0030.00519.16
8.1.200.0000.00917.63
8.1.190.0030.00517.48
8.1.180.0060.00319.46
8.1.170.0000.00918.90
8.1.160.0040.00419.34
8.1.150.0000.00719.29
8.1.140.0040.00421.13
8.1.130.0000.00717.71
8.1.120.0000.00817.71
8.1.110.0040.00417.70
8.1.100.0050.00517.69
8.1.90.0050.00517.85
8.1.80.0000.00917.85
8.1.70.0030.00317.64
8.1.60.0000.00818.00
8.1.50.0030.00617.86
8.1.40.0040.00417.93
8.1.30.0040.00417.94
8.1.20.0030.00617.93
8.1.10.0000.00817.96
8.1.00.0080.00017.88
8.0.300.0080.00020.39
8.0.290.0040.00417.25
8.0.280.0020.00518.79
8.0.270.0000.00717.20
8.0.260.0000.00617.07
8.0.250.0070.00017.31
8.0.240.0050.00417.23
8.0.230.0000.00717.29
8.0.220.0030.00517.18
8.0.210.0040.00417.26
8.0.200.0030.00317.26
8.0.190.0030.00517.22
8.0.180.0000.00817.26
8.0.170.0000.01017.14
8.0.160.0040.00417.29
8.0.150.0050.00317.12
8.0.140.0050.00217.23
8.0.130.0000.00613.60
8.0.120.0000.00717.15
8.0.110.0070.00017.34
8.0.100.0000.00717.15
8.0.90.0000.00917.16
8.0.80.0070.00817.20
8.0.70.0040.00416.97
8.0.60.0040.00417.18
8.0.50.0000.00817.16
8.0.30.0080.00817.46
8.0.20.0060.01417.38
8.0.10.0050.00217.15
8.0.00.0100.00717.29
7.4.330.0020.00216.93
7.4.320.0000.00616.93
7.4.300.0030.00616.96
7.4.290.0040.00416.92
7.4.280.0030.00516.89
7.4.270.0000.00716.88
7.4.260.0030.00313.63
7.4.250.0030.00316.79
7.4.240.0040.00316.90
7.4.230.0000.00716.70
7.4.220.0020.00516.95
7.4.210.0080.00816.90
7.4.200.0070.00016.66
7.4.130.0090.01016.77
7.4.120.0120.00616.80
7.4.110.0090.01516.72
7.4.100.0070.01016.82
7.4.90.0040.01516.76
7.4.80.0070.01019.39
7.4.70.0140.00716.96
7.4.60.0060.01016.84
7.4.50.0070.00716.59
7.4.40.0060.00916.77
7.4.10.0060.00915.11
7.4.00.0060.00915.25
7.3.330.0000.00716.64
7.3.320.0000.00513.46
7.3.310.0000.00716.60
7.3.300.0030.00316.52
7.3.290.0100.00716.58
7.3.260.0170.01716.83
7.3.230.0140.01016.70
7.3.210.0090.00916.69
7.3.200.0090.00616.68
7.3.190.0090.01016.70
7.3.180.0040.01916.88
7.3.170.0100.00716.56
7.3.160.0040.01216.62
7.3.130.0060.00914.92
7.3.120.0090.00714.96
7.3.110.0080.00814.78
7.3.100.0070.00714.58
7.3.90.0060.00914.74
7.3.80.0080.00514.68
7.3.70.0100.00514.68
7.3.60.0110.00414.89
7.3.50.0080.01114.62
7.3.40.0050.01014.66
7.3.30.0030.01014.74
7.3.20.0100.00614.87
7.3.10.0120.00514.86
7.3.00.0080.00615.00
7.2.330.0100.00716.88
7.2.320.0090.00916.91
7.2.310.0120.00417.02
7.2.300.0070.01016.78
7.2.290.0060.01616.69
7.2.260.0080.00715.09
7.2.250.0060.00915.13
7.2.240.0090.00615.11
7.2.230.0020.01215.05
7.2.220.0040.01115.04
7.2.210.0060.00915.10
7.2.200.0040.01215.14
7.2.190.0090.00815.10
7.2.180.0100.00915.00
7.2.170.0050.01115.27
7.2.160.0110.00315.22
7.2.150.0090.00715.23
7.2.140.0050.01115.09
7.2.130.0110.00315.13
7.2.120.0050.01315.15
7.2.110.0050.01015.23
7.2.100.0070.00814.86
7.2.90.0090.00815.20
7.2.80.0050.01015.08
7.2.70.0000.01615.08
7.2.60.0040.01115.15
7.2.50.0060.00915.21
7.2.40.0070.00915.24
7.2.30.0080.00815.32
7.2.20.0090.00715.12
7.2.10.0080.00815.06
7.2.00.0140.00715.14

preferences:
123.37 ms | 403 KiB | 5 Q