3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument; $doc->loadHTML('<html><body id="x"><div id="y"></div></body></html>'); $body = $doc->getElementById('x'); $div = $doc->getElementById('y'); $body->removeChild($div); echo '1: ' . ( $doc->getElementById('y') ? $doc->getElementById('y')->tagName : 'null' ) . PHP_EOL; $div->setIdAttribute( 'id', true ); echo '2: ' . ( $doc->getElementById('y') ? $doc->getElementById('y')->tagName : 'null' ) . PHP_EOL;
based on GXaLf

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.0.0rc20.0090.00917.04
8.0.0rc10.0090.00916.94
8.0.0beta30.0110.01217.06
8.0.0beta10.0080.01116.89
8.0.0alpha30.0120.00616.99
8.0.0alpha20.0140.00316.73
8.0.0alpha10.0150.00716.69
7.4.110.0070.01016.78
7.4.100.0130.01016.76
7.4.90.0100.00716.72
7.4.80.0130.01219.39
7.4.70.0120.01216.77
7.4.60.0060.01216.79
7.4.50.0050.00516.73
7.4.40.0060.01216.67
7.4.00.0090.00614.94
7.3.230.0060.01616.83
7.3.210.0110.00616.93
7.3.200.0110.00516.56
7.3.190.0140.00716.44
7.3.180.0060.00916.46
7.3.170.0090.01216.60
7.3.160.0100.01016.46
7.3.20.1540.00714.91
7.3.10.1870.00814.88
7.3.00.1750.01214.91
7.2.330.0000.01816.98
7.2.320.0090.01816.80
7.2.310.0150.00616.63
7.2.300.0060.01116.67
7.2.290.0190.00016.69
7.2.150.1730.00315.15
7.2.140.1730.00715.20
7.2.130.1760.00815.39
7.2.120.1100.00515.25
7.2.110.1310.01015.18
7.2.100.1290.00815.22
7.2.90.1320.00515.22
7.2.80.0990.00815.12
7.2.70.1030.00315.34
7.2.60.1090.00215.21
7.2.50.0980.01114.99
7.2.40.0910.01015.00
7.2.30.1160.00215.16
7.2.20.1170.01015.22
7.2.10.0920.00215.25
7.2.00.0920.00515.07
7.1.250.1930.00714.03
7.1.240.0140.00814.02
7.1.230.2120.01014.06
7.1.220.2190.01013.82
7.1.210.2000.01414.15
7.1.200.1560.01013.88
7.1.190.1370.00314.08
7.1.180.1530.00013.82
7.1.170.1390.01213.92
7.1.160.1670.01014.16
7.1.150.1230.00714.15
7.1.140.1190.01014.04
7.1.130.1500.00314.03
7.1.120.1940.00714.20
7.1.110.1010.00314.21
7.1.100.1040.00713.69
7.1.90.0610.00313.79
7.1.80.0690.01014.07
7.1.70.0810.00013.98
7.1.60.0790.01314.13
7.1.50.0590.00613.84
7.1.40.0530.01614.23
7.1.30.0520.00714.11
7.1.20.0670.00013.86
7.1.10.0670.01014.14
7.1.00.4530.00614.14
7.0.330.3570.01613.55
7.0.320.2260.00313.72
7.0.310.1240.00713.91
7.0.300.1330.01313.60
7.0.290.1120.01013.73
7.0.280.1170.00713.61
7.0.270.1240.01313.59
7.0.260.1900.00713.63
7.0.250.1070.00713.75
7.0.240.1110.00313.52
7.0.230.0640.01713.81
7.0.220.0690.00713.48
7.0.210.0660.01313.88
7.0.200.0700.00513.69
7.0.190.0540.00613.69
7.0.180.0510.02213.79
7.0.170.0730.01013.85
7.0.160.0670.00613.53
7.0.150.0610.00013.74
7.0.140.0570.00913.73
7.0.130.0620.00713.61
7.0.120.0560.00613.63
7.0.110.0590.00013.80
7.0.100.0520.01313.85
7.0.90.0620.00613.66
7.0.80.0660.00813.64
7.0.70.0600.00913.60
7.0.60.0610.01413.66
7.0.50.0570.00313.93
7.0.40.0580.01913.73
7.0.30.0560.00713.73
7.0.20.0620.00713.71
7.0.10.0430.00913.55
7.0.00.0650.01013.84
5.6.380.0180.00514.60
5.6.370.0110.01414.57
5.6.360.0210.01014.44
5.6.350.0160.01614.09
5.6.340.0160.00814.63
5.6.330.0100.01014.47
5.6.320.0060.01214.11
5.6.310.0180.00714.54
5.6.300.0120.01414.23
5.6.290.0200.01014.34
5.6.280.0100.01914.59
5.6.270.0210.01414.33
5.6.260.0210.00814.71
5.6.250.0110.00714.34
5.6.240.0150.00414.36
5.6.230.0160.01314.39
5.6.220.0090.00914.49
5.6.210.0210.01414.34
5.6.200.0190.01114.36
5.6.190.0060.00914.38
5.6.180.0170.01014.40
5.6.170.0100.01214.48
5.6.160.0120.01014.25
5.6.150.0140.01014.44
5.6.140.0070.01114.32
5.6.130.0120.00914.45
5.6.120.0140.01414.36
5.6.110.0200.01414.45
5.6.100.0110.00514.50
5.6.90.0090.00914.32
5.6.80.0090.00914.48
5.6.70.0130.01314.45
5.6.60.0170.01014.26
5.6.50.0110.01514.20
5.6.40.0050.01414.43
5.6.30.0210.00614.23
5.6.20.0220.01114.13
5.6.10.0080.01114.19
5.6.00.0040.00914.32
5.5.380.0070.00711.11
5.5.370.0100.00311.30
5.5.360.0000.01411.04
5.5.350.0000.01611.21
5.5.340.0050.01011.45
5.5.330.0110.00511.16
5.5.320.0130.01011.30
5.5.310.0080.00811.08
5.5.300.0130.00311.39
5.5.290.0080.00810.99
5.5.280.0110.00011.10
5.5.270.0060.00511.08
5.5.260.0030.01011.34
5.5.250.0060.00611.15
5.5.240.0060.00611.17
5.5.230.0070.00711.10
5.5.220.0140.00711.13
5.5.210.0100.00711.11
5.5.200.0080.00511.14
5.5.190.0100.00511.21
5.5.180.0110.01111.11
5.5.170.0150.00310.87
5.5.160.0100.00011.22
5.5.150.0160.00310.73
5.5.140.0130.00011.14
5.5.130.0100.00810.86
5.5.120.0190.00010.73
5.5.110.0110.01511.16
5.5.100.0090.00310.95
5.5.90.0050.00710.95
5.5.80.0090.00311.10
5.5.70.0090.00611.14
5.5.60.0090.00911.13
5.5.50.0110.00010.96
5.5.40.0110.00711.16
5.5.30.0100.01010.96
5.5.20.0090.00911.17
5.5.10.0090.00911.05
5.5.00.0130.00711.18
5.4.450.0110.00710.92
5.4.440.0150.00311.14
5.4.430.0110.00010.94
5.4.420.0060.00610.98
5.4.410.0100.00310.95
5.4.400.0170.00010.90
5.4.390.0080.00311.07
5.4.380.0130.00611.03
5.4.370.0060.01311.39
5.4.360.0060.00611.25
5.4.350.0060.00611.32
5.4.340.0070.00710.98
5.4.330.0150.00511.38
5.4.320.0070.00410.94
5.4.310.0110.00510.85
5.4.300.0060.00611.20
5.4.290.0140.00611.11
5.4.280.0100.00511.15
5.4.270.0030.01011.31
5.4.260.0150.00310.92
5.4.250.0120.00610.73
5.4.240.0080.00810.93
5.4.230.0170.00310.89
5.4.220.0070.00411.26
5.4.210.0140.00310.86
5.4.200.0060.01111.21
5.4.190.0190.00011.18
5.4.180.0080.01511.16
5.4.170.0000.01010.92
5.4.160.0200.00010.89
5.4.150.0120.01210.83
5.4.140.0090.00711.08
5.4.130.0120.00011.01
5.4.120.0080.00811.03
5.4.110.0030.00910.93
5.4.100.0100.00011.20
5.4.90.0190.00310.89
5.4.80.0100.00310.91
5.4.70.0050.00510.86
5.4.60.0040.01311.13
5.4.50.0040.01210.77
5.4.40.0030.00711.04
5.4.30.0080.01110.99
5.4.20.0060.01311.05
5.4.10.0130.01011.05
5.4.00.0100.00010.70
5.3.290.0130.00010.62
5.3.280.0110.00610.50
5.3.270.0120.00410.55
5.3.260.0170.00310.55
5.3.250.0140.00710.63
5.3.240.0060.00610.39
5.3.230.0170.00010.59
5.3.220.0120.00210.38
5.3.210.0160.00010.33
5.3.200.0070.00310.21
5.3.190.0120.00410.53
5.3.180.0090.00310.52
5.3.170.0040.01110.66
5.3.160.0110.00010.55
5.3.150.0070.00410.65
5.3.140.0100.00010.48
5.3.130.0110.00410.50
5.3.120.0090.00510.50
5.3.110.0130.00710.32
5.3.100.0170.00210.47
5.3.90.0090.00810.54
5.3.80.0190.00310.33
5.3.70.0070.01110.38
5.3.60.0140.00610.63
5.3.50.0130.00410.49
5.3.40.0160.00310.25
5.3.30.0110.00010.53
5.3.20.0080.00410.53
5.3.10.0070.01110.14
5.3.00.0120.00610.26
5.2.170.0090.0039.61
5.2.160.0120.0059.62
5.2.150.0050.0099.64
5.2.140.0070.0039.48
5.2.130.0060.0039.28
5.2.120.0110.0079.58
5.2.110.0150.0009.34
5.2.100.0110.0069.57
5.2.90.0100.0039.39
5.2.80.0040.0049.33
5.2.70.0050.0049.45
5.2.60.0000.0089.14
5.2.50.0040.0089.44
5.2.40.0100.0039.52
5.2.30.0040.0049.34
5.2.20.0070.0039.27
5.2.10.0090.0069.27
5.2.00.0090.0069.04
5.1.60.0110.0038.77
5.1.50.0040.0048.77
5.1.40.0060.0098.77
5.1.30.0090.0008.77
5.1.20.0050.0078.77
5.1.10.0140.0038.77
5.1.00.0080.0008.77
5.0.50.0030.0038.77
5.0.40.0060.0068.77
5.0.30.0130.0008.77
5.0.20.0050.0098.77
5.0.10.0040.0048.77
5.0.00.0060.0068.77
4.4.90.0000.0058.77
4.4.80.0070.0008.77
4.4.70.0050.0008.77
4.4.60.0020.0028.77
4.4.50.0070.0038.77
4.4.40.0060.0008.77
4.4.30.0040.0078.77
4.4.20.0030.0038.77
4.4.10.0030.0018.77
4.4.00.0040.0028.77
4.3.110.0080.0008.77
4.3.100.0000.0128.77
4.3.90.0000.0058.77
4.3.80.0040.0078.77
4.3.70.0120.0008.77
4.3.60.0080.0008.77
4.3.50.0040.0028.77
4.3.40.0030.0038.77
4.3.30.0000.0048.77
4.3.20.0100.0008.77
4.3.10.0050.0008.77
4.3.00.0000.0058.77