3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test( $input) { $doc = new DOMDocument; $doc->loadHTML( $input); print_r($input); /* $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.0210.00017.00
8.3.50.0130.00622.02
8.3.40.0060.00918.94
8.3.30.0120.00319.34
8.3.20.0070.00020.58
8.3.10.0040.00423.65
8.3.00.0080.00021.15
8.2.180.0080.01116.88
8.2.170.0120.00422.96
8.2.160.0070.00720.61
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0000.00821.23
8.2.110.0060.00322.32
8.2.100.0040.00817.97
8.2.90.0040.00419.30
8.2.80.0040.00417.97
8.2.70.0070.00317.75
8.2.60.0000.00818.29
8.2.50.0060.00318.07
8.2.40.0000.00821.19
8.2.30.0040.00418.54
8.2.20.0040.00417.83
8.2.10.0000.00818.32
8.2.00.0000.00917.86
8.1.280.0110.00425.92
8.1.270.0060.00323.95
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00422.56
8.1.230.0070.00419.52
8.1.220.0000.00917.91
8.1.210.0000.00818.77
8.1.200.0030.00617.73
8.1.190.0030.00617.48
8.1.180.0040.00418.10
8.1.170.0080.00019.03
8.1.160.0000.00722.34
8.1.150.0000.00718.98
8.1.140.0000.00717.59
8.1.130.0040.00418.00
8.1.120.0070.00017.71
8.1.110.0000.00717.62
8.1.100.0040.00417.57
8.1.90.0040.00417.60
8.1.80.0060.00317.67
8.1.70.0000.00717.59
8.1.60.0050.00317.77
8.1.50.0070.00017.72
8.1.40.0050.00317.77
8.1.30.0000.00717.88
8.1.20.0040.00417.89
8.1.10.0070.00017.76
8.1.00.0070.00417.77
8.0.300.0040.00418.77
8.0.290.0070.00017.41
8.0.280.0000.00718.61
8.0.270.0040.00417.39
8.0.260.0030.00317.50
8.0.250.0030.00317.23
8.0.240.0000.00717.19
8.0.230.0030.00317.24
8.0.220.0000.00717.09
8.0.210.0040.00417.18
8.0.200.0000.00617.15
8.0.190.0060.00317.23
8.0.180.0060.00317.10
8.0.170.0090.00017.24
8.0.160.0040.00417.18
8.0.150.0000.00817.13
8.0.140.0070.00017.05
8.0.130.0040.00413.68
8.0.120.0000.00817.05
8.0.110.0050.00317.10
8.0.100.0030.00517.23
8.0.90.0000.00717.00
8.0.80.0110.01117.19
8.0.70.0040.00417.08
8.0.60.0070.00017.23
8.0.50.0040.00417.04
8.0.30.0050.01417.36
8.0.20.0100.00817.54
8.0.10.0000.00717.32
8.0.00.0080.01017.07
7.4.330.0000.00515.00
7.4.320.0000.00716.57
7.4.300.0050.00216.78
7.4.290.0000.00716.79
7.4.280.0040.00416.72
7.4.270.0040.00316.84
7.4.260.0000.00716.77
7.4.250.0050.00316.71
7.4.240.0060.00116.75
7.4.230.0050.00317.00
7.4.220.0070.01716.72
7.4.210.0090.00816.98
7.4.200.0040.00416.93
7.4.190.0030.00316.61
7.4.160.0040.01216.82
7.4.150.0140.00717.40
7.4.140.0130.00917.86
7.4.130.0180.00316.73
7.4.120.0130.00716.71
7.4.110.0080.01116.77
7.4.100.0060.01616.98
7.4.90.0070.01316.88
7.4.80.0150.00319.39
7.4.70.0080.00916.92
7.4.60.0100.00716.61
7.4.50.0040.00416.70
7.4.40.0140.00317.02
7.4.30.0160.00716.78
7.4.00.0040.01114.77
7.3.330.0050.00013.48
7.3.320.0000.00613.45
7.3.310.0040.00416.59
7.3.300.0070.00016.56
7.3.290.0150.00016.59
7.3.280.0110.00816.52
7.3.270.0130.00317.40
7.3.260.0070.01116.70
7.3.250.0070.01016.61
7.3.240.0140.00316.80
7.3.230.0060.01016.41
7.3.210.0160.00316.87
7.3.200.0030.01219.39
7.3.190.0150.00316.70
7.3.180.0200.00316.75
7.3.170.0130.00316.64
7.3.160.0150.00016.54
7.3.120.0040.00414.68
7.2.330.0060.01216.81
7.2.320.0170.00016.89
7.2.310.0070.01016.91
7.2.300.0070.01016.83
7.2.290.0120.00616.70
7.1.70.0100.00317.26
7.1.60.0140.01019.46
7.1.50.0090.01216.78
7.1.00.0030.07722.48
7.0.200.0000.00716.51
7.0.140.0030.07322.05
7.0.60.0230.06020.00
7.0.50.0030.04017.95
7.0.40.0130.06020.04
7.0.30.0200.04320.20
7.0.20.0330.07020.23
7.0.10.0100.05020.14
7.0.00.0200.08020.33
5.6.280.0000.07720.95
5.6.210.0200.06020.55
5.6.200.0070.04018.27
5.6.190.0070.08320.54
5.6.180.0470.07020.54
5.6.170.0200.04320.59
5.6.160.0030.04020.63
5.6.150.0000.04718.24
5.6.140.0030.04018.42
5.6.130.0070.09018.25
5.6.120.0070.08321.04
5.6.110.0070.03721.12
5.6.100.0030.04321.14
5.6.90.0130.05721.15
5.6.80.0170.07320.43
5.5.350.0300.07720.39
5.5.340.0070.06318.02
5.5.330.0030.04720.29
5.5.320.0000.08720.34
5.5.310.0300.07020.27
5.5.300.0070.06718.02
5.5.290.0000.04318.09
5.5.280.0100.08020.70
5.5.270.0000.05021.01
5.5.260.0130.08320.94
5.5.250.0100.03320.67
5.5.240.0100.07020.39
5.4.450.0770.05719.55
5.4.440.0070.05719.67
5.4.430.0830.05019.67
5.4.420.1100.04319.54
5.4.410.1200.04719.41
5.4.400.0900.06318.98
5.4.390.1130.04719.11
5.4.380.0170.05318.92
5.4.370.0230.04318.84
5.4.360.0130.05018.86
5.4.350.0170.05318.79
5.4.340.0070.06318.61
5.4.320.0100.04112.66
5.4.310.0060.03712.66
5.4.300.0070.03612.66
5.4.290.0080.03612.66
5.4.280.0070.03512.56
5.4.270.0050.04312.56
5.4.260.0080.05212.56
5.4.250.0070.05112.56
5.4.240.0080.05112.56
5.4.230.0080.05012.55
5.4.220.0070.04812.55
5.4.210.0080.03912.55
5.4.200.0080.04712.55
5.4.190.0090.04212.54
5.4.180.0100.03712.55
5.4.170.0060.03812.56
5.4.160.0130.04312.56
5.4.150.0100.05212.55
5.4.140.0110.04812.24
5.4.130.0080.04912.23
5.4.120.0110.03912.18
5.4.110.0100.03712.18
5.4.100.0100.03312.18
5.4.90.0120.04312.18
5.4.80.0100.04912.18
5.4.70.0080.05012.17
5.4.60.0040.04112.18
5.4.50.0090.04512.16
5.4.40.0090.04612.15
5.4.30.0060.04812.15
5.4.20.0110.04112.16
5.4.10.0080.04812.15
5.4.00.0100.04311.64
5.3.290.0050.04012.93
5.3.280.0060.04412.86
5.3.270.0140.04512.86
5.3.260.0070.04512.86
5.3.250.0060.04012.86
5.3.240.0060.03812.86
5.3.230.0070.04112.85
5.3.220.0060.04312.82
5.3.210.0050.04812.83
5.3.200.0050.05612.82
5.3.190.0050.04612.83
5.3.180.0050.03912.82
5.3.170.0060.03812.82
5.3.160.0070.04712.82
5.3.150.0090.03712.82
5.3.140.0060.03812.82
5.3.130.0050.04212.80
5.3.120.0080.03812.80
5.3.110.0090.03812.81
5.3.100.0070.03712.29
5.3.90.0050.03812.28
5.3.80.0070.03612.27
5.3.70.0080.03512.27
5.3.60.0070.03612.25
5.3.50.0050.03812.20
5.3.40.0060.03812.20
5.3.30.0050.03612.16
5.3.20.0070.03511.95
5.3.10.0040.03711.91
5.3.00.0040.03811.89
5.2.170.0040.0329.40
5.2.160.0030.0309.40
5.2.150.0050.0309.40
5.2.140.0030.0339.39
5.2.130.0060.0289.36
5.2.120.0080.0269.36
5.2.110.0030.0329.36
5.2.100.0080.0269.36
5.2.90.0050.0299.36
5.2.80.0030.0329.36
5.2.70.0040.0319.36
5.2.60.0040.0339.30
5.2.50.0030.0339.27
5.2.40.0030.0309.25
5.2.30.0030.0319.23
5.2.20.0050.0299.21
5.2.10.0060.0279.11
5.2.00.0080.0268.97
5.1.60.0040.0258.26
5.1.50.0020.0288.25
5.1.40.0030.0268.23
5.1.30.0040.0278.58
5.1.20.0060.0258.61
5.1.10.0040.0268.33
5.1.00.0050.0268.33
5.0.50.0050.0206.81
5.0.40.0070.0166.68
5.0.30.0030.0326.49
5.0.20.0040.0196.45
5.0.10.0070.0176.44
5.0.00.0050.0306.43
4.4.90.0030.0174.78
4.4.80.0040.0154.76
4.4.70.0020.0214.75
4.4.60.0020.0184.76
4.4.50.0020.0174.77
4.4.40.0040.0284.71
4.4.30.0040.0174.76
4.4.20.0030.0164.85
4.4.10.0030.0154.84
4.4.00.0040.0234.76
4.3.110.0030.0154.66
4.3.100.0030.0214.67
4.3.90.0020.0154.64
4.3.80.0020.0254.59
4.3.70.0010.0164.63
4.3.60.0050.0124.63
4.3.50.0020.0164.62
4.3.40.0060.0214.54
4.3.30.0040.0143.30
4.3.20.0010.0183.28
4.3.10.0020.0163.24
4.3.00.0100.01016.14

preferences:
37.05 ms | 401 KiB | 5 Q