3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = ' Here is some text and also: <figure class="class-one"> <img src="/example.jpg" alt="example alt" class="some-image-class"> <figcaption>example caption</figcaption> </figure> And another one (and many more): <figure class="class-one some-other-class"> <img src="/example2.jpg" alt="example2 alt"> </figure>'; $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML($html); libxml_clear_errors(); $images = $dom->getElementsByTagName('img'); $figures = $dom->getElementsByTagName('figure'); $figures = array(); foreach ($figures as $figure) { $figures['class'] = $figure->getAttribute('class'); } print_r($figures);

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.0100.01020.61
8.4.110.0120.00918.80
8.4.100.0140.00617.80
8.4.90.0130.00918.73
8.4.80.0060.00318.85
8.4.70.0110.00819.82
8.4.60.0100.01019.21
8.4.50.0110.00918.73
8.4.40.0060.00319.44
8.4.30.0090.01018.66
8.4.20.0150.00624.64
8.4.10.0070.00317.88
8.3.250.0100.01019.18
8.3.240.0060.00517.03
8.3.230.0120.00716.86
8.3.220.0070.00319.10
8.3.210.0100.00816.77
8.3.200.0060.00316.97
8.3.190.0100.01117.37
8.3.180.0140.00617.35
8.3.170.0070.01122.97
8.3.160.0070.01117.22
8.3.150.0060.00317.33
8.3.140.0040.00416.97
8.3.130.0050.00317.62
8.3.120.0090.00518.91
8.3.110.0060.00717.68
8.3.100.0100.00816.80
8.3.90.0140.00718.42
8.3.80.0140.00317.49
8.3.70.0160.00517.48
8.3.60.0150.00417.51
8.3.50.0130.00717.20
8.3.40.0120.00517.97
8.3.30.0090.00719.84
8.3.20.0140.00221.11
8.3.10.0090.00421.19
8.3.00.0070.00521.38
8.2.290.0120.00720.54
8.2.280.0120.00918.74
8.2.270.0150.00416.85
8.2.260.0070.00719.22
8.2.250.0110.00716.59
8.2.240.0140.00517.06
8.2.230.0090.00518.84
8.2.220.0080.00620.42
8.2.210.0080.00721.62
8.2.200.0120.00417.58
8.2.190.0130.00516.61
8.2.180.0120.00616.75
8.2.170.0120.00720.40
8.2.160.0170.00220.38
8.2.150.0100.00421.58
8.2.140.0090.00821.77
8.2.130.0110.00422.17
8.2.120.0130.00420.24
8.2.110.0150.00119.99
8.2.100.0120.00519.53
8.2.90.0080.00819.56
8.2.80.0100.00619.83
8.2.70.0120.00534.83
8.2.60.0100.00734.41
8.2.50.0090.00426.31
8.2.40.0110.00535.21
8.2.30.0120.00434.85
8.2.20.0090.00434.58
8.2.10.0130.00334.85
8.2.00.0130.00229.29
8.1.330.0110.00822.03
8.1.320.0050.00516.51
8.1.310.0060.01217.04
8.1.300.0150.00318.16
8.1.290.0100.00517.46
8.1.280.0120.00621.90
8.1.270.0120.00521.80
8.1.260.0110.00622.50
8.1.250.0080.00623.25
8.1.240.0100.00319.93
8.1.230.0100.00520.42
8.1.220.0080.00519.74
8.1.210.0100.00519.73
8.1.200.0100.00534.27
8.1.190.0100.00534.27
8.1.180.0080.00528.94
8.1.170.0090.00634.60
8.1.160.0100.00534.67
8.1.150.0100.00434.70
8.1.140.0120.00234.66
8.1.130.0080.00628.79
8.1.120.0090.00634.33
8.1.110.0080.00834.31
8.1.100.0080.00831.05
8.1.90.0100.00431.01
8.1.80.0090.00630.98
8.1.70.0070.00730.95
8.1.60.0130.00528.86
8.1.50.0130.00528.80
8.1.40.0100.00623.79
8.1.30.0090.00727.30
8.1.20.0140.00327.34
8.1.10.0130.00427.19
8.1.00.0120.00527.19
8.0.300.0070.00919.50
8.0.290.0130.00533.95
8.0.280.0100.00728.98
8.0.270.0140.00333.99
8.0.260.0140.00433.98
8.0.250.0100.00834.05
8.0.240.0140.00334.04
8.0.230.0120.00430.66
8.0.220.0100.00430.60
8.0.210.0100.00630.67
8.0.200.0110.00530.63
8.0.190.0100.00625.57
8.0.180.0120.00528.35
8.0.170.0110.00526.79
8.0.160.0110.00526.79
8.0.150.0100.00726.68
8.0.140.0110.00626.70
8.0.130.0130.00426.55
8.0.120.0140.00325.10
8.0.110.0110.00525.10
8.0.100.0110.00425.10
8.0.90.0120.00425.09
8.0.80.0100.00725.14
8.0.70.0100.00525.05
8.0.60.0120.00425.12
8.0.50.0090.00625.09
8.0.30.0110.00522.95
8.0.20.0090.00723.54
8.0.10.0090.00624.32
8.0.00.0110.00722.49
7.4.330.0100.00633.61
7.4.320.0100.00633.83
7.4.300.0120.00430.54
7.4.290.0090.00728.22
7.4.280.0120.00426.54
7.4.270.0090.00826.46
7.4.260.0110.00426.48
7.4.250.0140.00424.93
7.4.240.0120.00524.02
7.4.230.0120.00524.91
7.4.220.0130.00424.89
7.4.210.0110.00623.24
7.4.200.0110.00424.88
7.4.190.0130.00426.15
7.4.180.0140.00326.13
7.4.160.0110.00722.17
7.4.150.0100.00623.95
7.4.140.0120.00423.85
7.4.130.0090.00623.15
7.4.120.0100.00722.01
7.4.110.0110.00621.65
7.4.100.0100.00821.70
7.4.90.0100.00821.70
7.4.80.0120.00621.87
7.4.70.0100.00721.74
7.4.60.0120.00621.69
7.4.50.0110.00621.58
7.4.40.0100.00621.63
7.4.30.0110.00622.08
7.4.20.0110.00522.09
7.4.10.0130.00522.07
7.4.00.0090.00621.59
7.3.330.0130.00525.87
7.3.320.0120.00524.29
7.3.310.0150.00324.70
7.3.300.0130.00524.69
7.3.290.0150.00524.68
7.3.280.0120.00723.05
7.3.270.0140.00523.76
7.3.260.0120.00720.91
7.3.250.0150.00423.81
7.3.240.0110.00720.87
7.3.230.0140.00621.55
7.3.220.0130.00721.98
7.3.210.0130.00721.51
7.3.200.0130.00721.56
7.3.190.0110.00721.57
7.3.180.0120.00721.57
7.3.170.0110.00721.59
7.3.160.0120.00721.56
7.3.150.0130.00721.96
7.3.140.0130.00621.95
7.3.130.0110.00721.97
7.3.120.0120.00722.00
7.3.110.0120.00721.96
7.3.100.0130.00522.07
7.3.90.0130.00622.11
7.3.80.0130.00521.96
7.3.70.0110.00722.01
7.3.60.0110.00721.01
7.3.50.0120.00721.01
7.3.40.0140.00420.99
7.3.30.0120.00621.00
7.3.20.0150.00621.70
7.3.10.0140.00621.64
7.3.00.0110.00821.58
7.2.340.0120.00922.08
7.2.330.0150.00521.74
7.2.320.0130.00721.68
7.2.310.0160.00521.72
7.2.300.0130.00721.70
7.2.290.0140.00721.72
7.2.280.0140.00722.11
7.2.270.0150.00622.10
7.2.260.0150.00722.12
7.2.250.0150.00522.14
7.2.240.0140.00622.08
7.2.230.0140.00822.12
7.2.220.0130.00622.09
7.2.210.0140.00622.09
7.2.200.0170.00722.18
7.2.190.0140.00621.17
7.2.180.0130.00621.13
7.2.170.0140.00821.19
7.2.160.0130.00721.17
7.2.150.0150.00821.84
7.2.140.0170.00621.89
7.2.130.0140.00721.91
7.2.120.0130.00721.92
7.2.110.0140.00921.98
7.2.100.0140.00621.89
7.2.90.0130.00921.92
7.2.80.0130.00721.83
7.2.70.0160.00721.85
7.2.60.0140.00821.87
7.2.50.0130.00821.85
7.2.40.0130.00821.88
7.2.30.0150.00721.91
7.2.20.0140.00721.94
7.2.10.0150.00721.93
7.2.00.0160.00621.87
7.1.330.0140.00621.92
7.1.320.0150.00521.98
7.1.310.0160.00521.90
7.1.300.0160.00420.92
7.1.290.0160.00520.92
7.1.280.0130.00720.93
7.1.270.0140.00720.94
7.1.260.0140.00620.95
7.1.250.0160.00820.82
7.1.240.0150.00621.85
7.1.230.0160.00621.91
7.1.220.0160.00521.91
7.1.210.0150.00821.91
7.1.200.0160.00621.88
7.1.190.0140.00721.92
7.1.180.0150.00621.86
7.1.170.0150.00621.87
7.1.160.0150.00621.85
7.1.150.0120.00821.84
7.1.140.0140.00821.74
7.1.130.0140.00721.86
7.1.120.0130.00721.88
7.1.110.0140.00621.92
7.1.100.0140.00621.86
7.1.90.0140.00721.90
7.1.80.0140.00721.87
7.1.70.0140.00721.82
7.1.60.0150.00621.92
7.1.50.0150.00521.94
7.1.40.0140.00621.91
7.1.30.0140.00721.92
7.1.20.0140.00721.87
7.1.10.0130.00721.89
7.1.00.0140.00621.85
5.3.290.0100.00816.18

preferences:
30.45 ms | 403 KiB | 5 Q