3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<table id="transactions" class="table"> <thead> <tr> <th class="image"></th> <th class="title"><span>Title</span></th> </tr> </thead> <tbody> <tr class="tbody-tr"> <td class="image"> <img src="http://www.example.com/image.jpg"> </td> <td class="title">Title </td> <td class="date">12/16/2017 </td> </tr> <tr class="tbody-tr"> <td class="image"> <img src="http://www.example.com/image.jpg"> </td> <td class="title">Title </td> <td class="date">12/16/2017 </td> </tr> </tbody> </table>'; $doc = new DOMDocument(); $doc->loadHTML($html); $doc->formatOutput = true; foreach ($doc->getElementsByTagName('tr') as $tr) { $td = $doc->createElement('td'); $td->setAttribute('class', 'example'); $tr->insertBefore($td, $tr->childNodes->item(3)); } echo $doc->saveHTML();

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.130.0060.00318.64
8.3.120.0060.01321.18
8.3.110.0160.00016.88
8.3.100.0090.00024.06
8.3.90.0000.00726.77
8.3.80.0090.00018.68
8.3.70.0080.00817.00
8.3.60.0120.00616.75
8.3.50.0150.00017.64
8.3.40.0180.00019.22
8.3.30.0030.01219.23
8.3.20.0000.00822.15
8.3.10.0050.00323.91
8.3.00.0050.00322.15
8.2.250.0030.00616.80
8.2.240.0070.00417.50
8.2.230.0070.00320.94
8.2.220.0060.00637.54
8.2.210.0000.00826.77
8.2.200.0050.00517.00
8.2.190.0090.00616.88
8.2.180.0070.01516.75
8.2.170.0090.00622.96
8.2.160.0030.01020.64
8.2.150.0050.00324.18
8.2.140.0120.00324.66
8.2.130.0070.00020.72
8.2.120.0030.00626.35
8.2.110.0030.00721.26
8.2.100.0090.00318.09
8.2.90.0000.00820.80
8.2.80.0000.00920.75
8.2.70.0040.00417.75
8.2.60.0000.00917.88
8.2.50.0040.00418.05
8.2.40.0000.00818.30
8.2.30.0040.00419.46
8.2.20.0030.00518.45
8.2.10.0070.00018.46
8.2.00.0000.00818.39
8.1.300.0100.01020.63
8.1.290.0030.00630.84
8.1.280.0110.00425.92
8.1.270.0040.00422.33
8.1.260.0040.00426.35
8.1.250.0030.00728.09
8.1.240.0000.00922.42
8.1.230.0060.00621.41
8.1.220.0030.00518.03
8.1.210.0050.00319.23
8.1.200.0070.00317.85
8.1.190.0050.00317.60
8.1.180.0030.00618.10
8.1.170.0040.00417.89
8.1.160.0050.00219.13
8.1.150.0040.00419.30
8.1.140.0040.00419.41
8.1.130.0020.00519.10
8.1.120.0040.00717.74
8.1.110.0070.00017.74
8.1.100.0060.00317.73
8.1.90.0050.00317.77
8.1.80.0040.00417.70
8.1.70.0030.00517.69
8.1.60.0000.00917.89
8.1.50.0000.00817.86
8.1.40.0040.00417.79
8.1.30.0000.00817.86
8.1.20.0040.00417.86
8.1.10.0050.00317.76
8.1.00.0000.00817.86
8.0.300.0070.00020.47
8.0.290.0040.00417.13
8.0.280.0030.00318.54
8.0.270.0030.00317.36
8.0.260.0000.00716.99
8.0.250.0030.00317.15
8.0.240.0070.00017.18
8.0.230.0000.00717.19
8.0.220.0030.00517.20
8.0.210.0060.00217.19
8.0.200.0030.00317.27
8.0.190.0040.00417.13
8.0.180.0040.00417.16
8.0.170.0040.00417.12
8.0.160.0000.00817.15
8.0.150.0000.00717.01
8.0.140.0040.00417.03
8.0.130.0000.00613.50
8.0.120.0040.00417.18
8.0.110.0050.00317.11
8.0.100.0000.00717.28
8.0.90.0070.00017.01
8.0.80.0100.00917.09
8.0.70.0000.00817.17
8.0.60.0000.00716.97
8.0.50.0040.00416.97
8.0.30.0060.01317.41
8.0.20.0130.01017.54
8.0.10.0000.00817.32
8.0.00.0120.00617.04
7.4.330.0000.00615.55
7.4.320.0030.00316.95
7.4.300.0040.00416.96
7.4.290.0030.00516.76
7.4.280.0030.00616.84
7.4.270.0070.00416.83
7.4.260.0000.00916.78
7.4.250.0000.00816.68
7.4.240.0000.00716.88
7.4.230.0030.00316.55
7.4.220.0000.00716.59
7.4.210.0060.00916.81
7.4.200.0030.00316.97
7.4.160.0090.00716.81
7.4.150.0130.00717.40
7.4.140.0100.00817.86
7.4.130.0090.01416.65
7.4.120.0100.01216.77
7.4.110.0120.00816.46
7.4.100.0120.00616.86
7.4.90.0100.00716.62
7.4.80.0110.00718.13
7.4.70.0100.01116.74
7.4.60.0090.01016.71
7.4.50.0080.01016.81
7.4.40.0130.00416.86
7.4.30.0110.00816.71
7.4.20.0120.00616.69
7.4.10.0040.01216.61
7.4.00.0060.01115.61
7.3.330.0050.00013.25
7.3.320.0070.00013.25
7.3.310.0030.00316.33
7.3.300.0030.00316.61
7.3.290.0090.01016.53
7.3.280.0070.01116.47
7.3.270.0160.00317.40
7.3.260.0110.00616.61
7.3.250.0060.01216.64
7.3.240.0100.00816.69
7.3.230.0120.00616.78
7.3.210.0110.00816.56
7.3.200.0090.01016.74
7.3.190.0070.01216.58
7.3.180.0100.01216.52
7.3.170.0120.00516.52
7.3.160.0110.00716.64
7.3.150.0130.00716.52
7.3.140.0030.01316.61
7.3.130.0100.00716.77
7.3.120.0090.00916.71
7.3.110.0060.01216.43
7.3.100.0090.00815.68
7.3.90.0040.01115.67
7.3.80.0080.00715.98
7.3.70.0050.01215.66
7.3.60.0080.00915.59
7.3.50.0080.00815.74
7.3.40.0060.00915.43
7.3.30.0050.01015.39
7.3.20.0120.00516.05
7.3.10.0060.00916.20
7.3.00.0100.00715.99
7.2.330.0090.01216.93
7.2.320.0080.01316.83
7.2.310.0110.01016.93
7.2.300.0090.00817.01
7.2.290.0080.00916.77
7.2.280.0120.00617.04
7.2.270.0140.00316.81
7.2.260.0060.01216.71
7.2.250.0060.01216.88
7.2.240.0090.00916.88
7.2.230.0100.00616.07
7.2.220.0020.01416.05
7.2.210.0100.00615.97
7.2.200.0090.00916.01
7.2.190.0080.00715.84
7.2.180.0090.01116.07
7.2.170.0070.01115.81
7.2.160.0110.00815.68
7.2.150.0070.01216.39
7.2.140.0100.00816.38
7.2.130.0080.00816.42
7.2.120.0070.01216.35
7.2.110.0090.00616.54
7.2.100.0110.00616.37
7.2.90.0110.00516.25
7.2.80.0110.00516.36
7.2.70.0110.00716.39
7.2.60.0100.01216.67
7.2.50.0120.00516.32
7.2.40.0100.00616.41
7.2.30.0110.00916.45
7.2.20.0110.00616.39
7.2.10.0090.01116.34
7.2.00.0100.01117.26
7.1.330.0160.01515.64
7.1.320.0240.00714.85
7.1.310.0210.00714.81
7.1.300.0140.01014.97
7.1.290.0150.00814.90
7.1.280.0160.00815.14
7.1.270.0130.00615.24
7.1.260.0140.00615.10
7.1.250.0080.01115.08
7.1.240.0170.00715.05
7.1.230.0110.01215.15
7.1.220.0120.00815.06
7.1.210.0250.00615.00
7.1.200.0170.00415.36
7.1.190.0140.00615.08
7.1.180.0120.01114.99
7.1.170.0140.00815.11
7.1.160.0070.01315.06
7.1.150.0120.01115.18
7.1.140.0150.01015.23
7.1.130.0210.00615.17
7.1.120.0110.01316.00
7.1.110.0100.01015.91
7.1.100.0160.00715.86
7.1.90.0140.00615.94
7.1.80.0120.00715.92
7.1.70.0110.00815.62
7.1.60.0180.01020.17
7.1.50.0160.00920.06
7.1.40.0200.00520.08
7.1.30.0160.00920.09
7.1.20.0180.01119.96
7.1.10.0140.00815.54
7.1.00.0130.01015.56
7.0.330.0090.01014.82
7.0.320.0240.00314.63
7.0.310.0150.00714.47
7.0.300.0150.00814.58
7.0.290.0200.00314.40
7.0.280.0110.01714.53
7.0.270.0210.00414.34
7.0.260.0250.01115.80
7.0.250.0160.00715.70
7.0.240.0150.00715.71
7.0.230.0170.00715.65
7.0.220.0170.00415.68
7.0.210.0140.00715.18
7.0.200.0150.00915.21
7.0.190.0130.00715.29
7.0.180.0130.00815.23
7.0.170.0160.00815.16
7.0.160.0150.01015.25
7.0.150.0130.01015.25
7.0.140.0180.00515.18
7.0.130.0130.01215.30
7.0.120.0100.01215.20
7.0.110.0110.01215.19
7.0.100.0130.01015.17
7.0.90.0120.00915.03
7.0.80.0190.00815.11
7.0.70.0130.00915.20
7.0.60.0150.00715.21
7.0.50.0150.00815.02
7.0.40.0110.01015.16
7.0.30.0090.00915.14
7.0.20.0180.00815.22
7.0.10.0160.01115.12
7.0.00.0130.00715.05
5.6.400.0120.00914.96
5.6.390.0130.00914.97
5.6.380.0130.00815.08
5.6.370.0180.00615.37
5.6.360.0150.01215.21
5.6.350.0160.01115.38
5.6.340.0200.00815.21
5.6.330.0200.00815.23
5.6.320.0120.01215.26
5.6.310.0120.01315.33
5.6.300.0140.02917.15
5.6.290.0120.03617.03
5.6.280.0110.03717.18
5.6.270.0140.03117.12
5.6.260.0150.03417.15
5.6.250.0110.03317.12
5.6.240.0150.03117.25
5.6.230.0130.02717.13
5.6.220.0150.03117.07
5.6.210.0090.03217.09
5.6.200.0130.03517.05
5.6.190.0140.02617.13
5.6.180.0120.03116.97
5.6.170.0180.03017.10
5.6.160.0140.02717.07
5.6.150.0150.02517.22
5.6.140.0130.02817.26
5.6.130.0120.02917.18
5.6.120.0150.02517.13
5.6.110.0160.02417.07
5.6.100.0140.02717.12
5.6.90.0180.02516.96
5.6.80.0170.02216.88
5.6.70.0110.03116.87
5.6.60.0110.03016.78
5.6.50.0140.02516.81
5.6.40.0180.02116.80
5.6.30.0160.02416.72
5.6.20.0140.02316.72
5.6.10.0150.02916.88
5.6.00.0160.03116.80
5.4.100.0100.00012.77
5.3.00.0080.00312.86

preferences:
28.2 ms | 403 KiB | 5 Q