3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test( $input) { $doc = new DOMDocument; $doc->loadHTML( $input);print_r($doc); /* $p = $doc->getElementsByTagName('a'); //->item(0); $children = $p->childNodes; $img_found = false; $error = false; foreach( $children as $child) { if( $child->nodeType == XML_TEXT_NODE && !$img_found) { // Text before the image, OK, continue on continue; } if( $child->nodeType == XML_ELEMENT_NODE) { if( !($child->tagName == 'img')) { // echo "Invalid HTML element found"; $error = true; } else { $img_found = true; } } else { // echo "Invalid node type!"; $error = true; } } if( $img_found && !$error) { echo 'ok' . "\n"; } else { echo 'NOT ok' . "\n"; }*/ } $input = addslashes('<a href="http://inorbit.in/whitefield/wp-content/uploads/sites/4/2014/06/Interschool-championship.gif"><a href="http://inorbit.in/whitefield/wp-content/uploads/sites/4/2014/06/IMG_0889.jpg"><img class="aligncenter size-full wp-image-1928" alt="sports championship competition" src="http://inorbit.in/whitefield/wp-content/uploads/sites/4/2014/06/IMG_0889.jpg" width="1024" height="768" /></a><a href="http://inorbit.in/whitefield/wp-content/uploads/sites/4/2014/06/IMG_0830.jpg"><img class="aligncenter size-full wp-image-1929" alt="sports championship competition" src="http://inorbit.in/whitefield/wp-content/uploads/sites/4/2014/06/IMG_0830.jpg" width="1024" height="768" /></a></a>'); // ok test( $input);

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.60.0120.00316.86
8.3.50.0100.00922.17
8.3.40.0090.00918.84
8.3.30.0040.01119.33
8.3.20.0080.00020.75
8.3.10.0000.00823.89
8.3.00.0080.00021.21
8.2.180.0000.01517.00
8.2.170.0000.01522.96
8.2.160.0140.00620.82
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0080.00021.04
8.2.110.0170.00322.36
8.2.100.0040.00819.70
8.2.90.0080.00019.17
8.2.80.0050.00317.97
8.2.70.0070.00317.63
8.2.60.0060.00317.93
8.2.50.0030.00618.07
8.2.40.0040.00421.19
8.2.30.0040.00418.47
8.2.20.0000.00717.87
8.2.10.0000.00818.39
8.2.00.0030.00617.93
8.1.280.0110.00325.92
8.1.270.0040.00424.09
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0180.00722.44
8.1.230.0060.00619.73
8.1.220.0000.00818.02
8.1.210.0050.00318.77
8.1.200.0030.00617.60
8.1.190.0040.00717.48
8.1.180.0080.00018.10
8.1.170.0080.00018.80
8.1.160.0040.00422.27
8.1.150.0040.00418.71
8.1.140.0080.00017.77
8.1.130.0030.00518.02
8.1.120.0030.00517.65
8.1.110.0070.00017.62
8.1.100.0040.00417.60
8.1.90.0050.00217.65
8.1.80.0040.00417.69
8.1.70.0000.00817.60
8.1.60.0000.00717.91
8.1.50.0030.00517.76
8.1.40.0030.00617.76
8.1.30.0000.00817.89
8.1.20.0040.00417.88
8.1.10.0050.00317.71
8.1.00.0030.00817.75
8.0.300.0070.00018.77
8.0.290.0040.00417.55
8.0.280.0000.00718.63
8.0.270.0030.00317.57
8.0.260.0000.00617.37
8.0.250.0050.00217.21
8.0.240.0060.00317.18
8.0.230.0040.00417.10
8.0.220.0000.00717.16
8.0.210.0040.00417.09
8.0.200.0030.00317.24
8.0.190.0030.00617.20
8.0.180.0070.00017.22
8.0.170.0040.00417.16
8.0.160.0000.00717.21
8.0.150.0080.00017.15
8.0.140.0000.00717.00
8.0.130.0030.00313.59
8.0.120.0050.00317.14
8.0.110.0000.01017.17
8.0.100.0070.00017.18
8.0.90.0000.00716.97
8.0.80.0060.00917.13
8.0.70.0040.00417.01
8.0.60.0000.00716.96
8.0.50.0000.00717.17
8.0.30.0080.01317.17
8.0.20.0100.00917.40
8.0.10.0000.00717.25
8.0.00.0090.00917.10
7.4.330.0060.00015.00
7.4.320.0030.00316.72
7.4.300.0060.00016.83
7.4.290.0040.00416.75
7.4.280.0070.00016.86
7.4.270.0000.00716.96
7.4.260.0030.00316.77
7.4.250.0000.00816.61
7.4.240.0020.00616.85
7.4.230.0050.00216.50
7.4.220.0040.01416.77
7.4.210.0080.00716.74
7.4.200.0040.00416.93
7.4.190.0030.00316.97
7.4.160.0110.00416.60
7.4.150.0070.01817.40
7.4.140.0050.01417.86
7.4.130.0100.00716.71
7.4.120.0090.01116.90
7.4.110.0030.01916.83
7.4.100.0030.01616.61
7.4.90.0080.01216.71
7.4.80.0130.00619.39
7.4.70.0130.00316.64
7.4.60.0160.00616.41
7.4.50.0030.00316.42
7.4.40.0130.00316.80
7.4.30.0070.01316.76
7.4.00.0030.01015.25
7.3.330.0000.00613.49
7.3.320.0000.00713.37
7.3.310.0050.00316.59
7.3.300.0030.00316.44
7.3.290.0060.01216.65
7.3.280.0080.01216.54
7.3.270.0140.00317.40
7.3.260.0160.00716.73
7.3.250.0100.00716.67
7.3.240.0120.00916.77
7.3.230.0070.01016.45
7.3.210.0090.00916.60
7.3.200.0090.00919.39
7.3.190.0070.01016.86
7.3.180.0050.01116.63
7.3.170.0060.00916.75
7.3.160.0080.00816.58
7.3.120.0070.00714.96
7.3.10.0070.00716.70
7.3.00.0070.00716.60
7.2.330.0000.01816.90
7.2.320.0120.00617.01
7.2.310.0060.00916.87
7.2.300.0060.00916.47
7.2.290.0130.01016.68
7.2.130.0000.01416.87
7.2.120.0000.01416.97
7.2.110.0080.00816.82
7.2.100.0080.00316.83
7.2.90.0040.01117.00
7.2.80.0040.01116.73
7.2.70.0060.00916.70
7.2.60.0040.00816.78
7.2.50.0040.01217.04
7.2.40.0030.01116.63
7.2.30.0030.01117.00
7.2.20.0130.00316.67
7.2.10.0000.01617.13
7.2.00.0060.00718.10
7.1.250.0040.00715.77
7.1.200.0040.00415.95
7.1.100.0040.00818.06
7.1.70.0000.00717.39
7.1.60.0070.01719.46
7.1.50.0070.00716.93
7.1.00.0030.07322.40
7.0.200.0080.00016.77
7.0.140.0100.06722.11
7.0.60.0070.07320.06
7.0.50.0070.08017.97
7.0.40.0030.08720.32
7.0.30.0130.04320.27
7.0.20.0170.04720.27
7.0.10.0170.07720.30
7.0.00.0030.04720.25
5.6.280.0070.07021.09
5.6.210.0130.07720.53
5.6.200.0100.08018.39
5.6.190.0070.04320.60
5.6.180.0100.06720.55
5.6.170.0200.07020.70
5.6.160.0030.04320.42
5.6.150.0100.08018.32
5.6.140.0100.06018.30
5.6.130.0070.04018.23
5.6.120.0100.07021.05
5.6.110.0030.04021.05
5.6.100.0100.08321.03
5.6.90.0030.08721.00
5.6.80.0230.06320.42
5.5.350.3830.04320.52
5.5.340.0100.03718.07
5.5.330.0130.07720.52
5.5.320.0330.07320.36
5.5.310.0400.07320.59
5.5.300.0070.08018.04
5.5.290.0070.08318.15
5.5.280.0030.04020.93
5.5.270.0200.06321.01
5.5.260.0070.04020.82
5.5.250.0070.04320.76
5.5.240.0030.06020.40
5.4.450.0300.04019.84
5.4.440.0200.05019.54
5.4.430.0270.05019.61
5.4.420.0400.04319.64
5.4.410.0300.04019.29
5.4.400.0230.04018.99
5.4.390.0930.04719.17
5.4.380.0130.05718.61
5.4.370.0300.03718.77
5.4.360.0130.05318.77
5.4.350.0100.06018.85
5.4.340.0130.05318.88
5.4.320.0050.03812.66
5.4.310.0080.04812.66
5.4.300.0060.03912.66
5.4.290.0060.05712.66
5.4.280.0080.03712.56
5.4.270.0100.04912.56
5.4.260.0100.05212.57
5.4.250.0070.05112.56
5.4.240.0090.03912.57
5.4.230.0060.04012.55
5.4.220.0070.03612.56
5.4.210.0040.04012.55
5.4.200.0080.03812.55
5.4.190.0070.03712.55
5.4.180.0100.03812.55
5.4.170.0100.05712.57
5.4.160.0120.04712.57
5.4.150.0060.05112.56
5.4.140.0110.03312.24
5.4.130.0090.03712.23
5.4.120.0090.03312.19
5.4.110.0060.03612.18
5.4.100.0080.03512.19
5.4.90.0060.03812.18
5.4.80.0080.04112.18
5.4.70.0060.04312.18
5.4.60.0040.04012.18
5.4.50.0060.03612.17
5.4.40.0050.03712.16
5.4.30.0070.03612.16
5.4.20.0050.03812.16
5.4.10.0080.03412.16
5.4.00.0060.03611.64
5.3.290.0080.04012.93
5.3.280.0060.03912.86
5.3.270.0050.04112.87
5.3.260.0110.03512.88
5.3.250.0080.03612.88
5.3.240.0080.04012.88
5.3.230.0050.04012.87
5.3.220.0040.04912.84
5.3.210.0110.05312.84
5.3.200.0050.04712.83
5.3.190.0050.04712.84
5.3.180.0100.04612.83
5.3.170.0030.04812.83
5.3.160.0100.04312.84
5.3.150.0090.04012.84
5.3.140.0110.03712.82
5.3.130.0090.03612.82
5.3.120.0070.04912.82
5.3.110.0080.05312.82
5.3.100.0130.04812.30
5.3.90.0080.05912.28
5.3.80.0050.05112.27
5.3.70.0080.05412.27
5.3.60.0080.05012.26
5.3.50.0060.03712.20
5.3.40.0040.03912.20
5.3.30.0080.03312.16
5.3.20.0070.03411.95
5.3.10.0040.03711.91
5.3.00.0070.03511.89
5.2.170.0030.0329.40
5.2.160.0040.0299.40
5.2.150.0030.0329.40
5.2.140.0050.0309.39
5.2.130.0050.0299.36
5.2.120.0050.0289.36
5.2.110.0070.0379.36
5.2.100.0060.0289.36
5.2.90.0020.0339.36
5.2.80.0090.0279.35
5.2.70.0070.0299.35
5.2.60.0140.0339.30
5.2.50.0090.0379.28
5.2.40.0070.0389.25
5.2.30.0050.0309.23
5.2.20.0070.0329.21
5.2.10.0050.0339.11
5.2.00.0050.0278.97
5.1.60.0070.0218.26
5.1.50.0030.0268.25
5.1.40.0020.0278.23
5.1.30.0060.0248.58
5.1.20.0060.0268.60
5.1.10.0010.0298.33
5.1.00.0070.0248.33
5.0.50.0020.0226.81
5.0.40.0040.0196.68
5.0.30.0020.0336.49
5.0.20.0040.0266.46
5.0.10.0030.0256.43
5.0.00.0040.0376.43
4.4.90.0050.0154.78
4.4.80.0060.0124.75
4.4.70.0000.0184.75
4.4.60.0030.0154.75
4.4.50.0060.0124.77
4.4.40.0040.0244.71
4.4.30.0060.0124.76
4.4.20.0030.0164.84
4.4.10.0000.0184.85
4.4.00.0010.0274.76
4.3.110.0040.0154.67
4.3.100.0020.0164.67
4.3.90.0020.0164.64
4.3.80.0030.0244.58
4.3.70.0050.0124.63
4.3.60.0030.0144.63
4.3.50.0030.0154.63
4.3.40.0010.0264.54
4.3.30.0020.0173.30
4.3.20.0010.0193.27
4.3.10.0020.0183.24
4.3.00.0030.01313.84

preferences:
51.78 ms | 401 KiB | 5 Q