3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<a href="http://www.mydomain.com/galeria/thumbnails.php?album=774" target="_blank"><img alt="/" src="http://img255.imageshack.us/img00/000/000001.png" height="133" width="113"></a>'; $doc = new DOMDocument; $doc->loadHTML( $html); $results = array(); foreach( $doc->getElementsByTagName( 'a') as $a) { // If there are no children, continue on if( !$a->hasChildNodes()) continue; // Find the child <img> tag, if it exists foreach( $a->childNodes as $child) { if( $child->nodeType == XML_ELEMENT_NODE && $child->tagName == 'img') { // Now we have the <a> tag in $a and the <img> tag in $child // Get the information we need: parse_str( parse_url( $a->getAttribute('href'), PHP_URL_QUERY), $a_params); $results[] = array( $a_params['album'], $child->getAttribute('src')); } } } var_dump( $results);

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.0000.01418.55
8.3.50.0230.00922.13
8.3.40.0070.01019.09
8.3.30.0060.00819.52
8.3.20.0080.00020.59
8.3.10.0080.00023.94
8.3.00.0040.00422.68
8.2.180.0070.01416.63
8.2.170.0070.01422.96
8.2.160.0070.00722.29
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00226.16
8.2.120.0000.00822.52
8.2.110.0090.00022.40
8.2.100.0060.00618.16
8.2.90.0030.00619.50
8.2.80.0030.00618.05
8.2.70.0090.00017.88
8.2.60.0040.00418.29
8.2.50.0040.00418.07
8.2.40.0080.00018.41
8.2.30.0080.00018.34
8.2.20.0000.00717.94
8.2.10.0090.00019.74
8.2.00.0040.00417.86
8.1.280.0140.00325.92
8.1.270.0080.00024.22
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0060.00323.91
8.1.230.0000.01119.20
8.1.220.0040.00418.01
8.1.210.0000.00918.77
8.1.200.0050.00517.60
8.1.190.0040.00417.78
8.1.180.0080.00018.10
8.1.170.0090.00018.89
8.1.160.0030.00622.21
8.1.150.0000.00718.87
8.1.140.0040.00417.54
8.1.130.0000.00717.98
8.1.120.0000.00717.64
8.1.110.0050.00217.59
8.1.100.0040.00317.57
8.1.90.0040.00817.67
8.1.80.0000.00717.66
8.1.70.0040.00417.66
8.1.60.0090.00017.83
8.1.50.0000.00817.77
8.1.40.0040.00417.66
8.1.30.0080.00017.81
8.1.20.0030.00517.84
8.1.10.0070.00017.68
8.1.00.0040.00417.81
8.0.300.0080.00018.77
8.0.290.0000.00817.30
8.0.280.0070.00018.64
8.0.270.0030.00317.51
8.0.260.0000.00717.15
8.0.250.0030.00317.16
8.0.240.0040.00417.16
8.0.230.0070.00017.26
8.0.220.0030.00517.12
8.0.210.0070.00317.02
8.0.200.0040.00417.18
8.0.190.0040.00417.06
8.0.180.0000.00717.04
8.0.170.0040.00417.05
8.0.160.0040.00416.96
8.0.150.0000.00717.05
8.0.140.0040.00417.06
8.0.130.0050.00013.45
8.0.120.0040.00417.04
8.0.110.0040.00417.02
8.0.100.0040.00417.08
8.0.90.0000.00716.82
8.0.80.0100.00717.02
8.0.70.0050.00217.25
8.0.60.0000.00817.13
8.0.50.0050.00217.17
8.0.30.0130.00517.51
8.0.20.0080.01117.40
8.0.10.0020.00517.06
8.0.00.0070.01217.04
7.4.330.0060.00015.18
7.4.320.0030.00316.69
7.4.300.0000.00616.60
7.4.290.0100.00016.68
7.4.280.0070.00016.86
7.4.270.0100.00016.82
7.4.260.0000.00716.76
7.4.250.0040.00416.71
7.4.240.0020.00516.78
7.4.230.0020.00516.51
7.4.220.0130.00316.78
7.4.210.0080.00916.69
7.4.200.0070.00016.79
7.4.190.0070.00016.93
7.4.160.0060.00916.82
7.4.150.0140.01217.40
7.4.140.0100.01017.86
7.4.130.0150.00316.67
7.4.120.0050.01116.75
7.4.110.0070.01516.77
7.4.100.0190.00616.67
7.4.90.0110.00616.59
7.4.80.0130.01019.39
7.4.70.0100.00616.61
7.4.60.0110.01416.67
7.4.50.0030.00616.46
7.4.40.0030.01222.77
7.4.30.0160.00016.92
7.4.00.0040.01415.16
7.3.330.0000.00513.28
7.3.320.0050.00013.34
7.3.310.0080.00016.45
7.3.300.0000.00716.30
7.3.290.0080.01216.29
7.3.280.0080.01016.43
7.3.270.0200.00317.40
7.3.260.0110.00816.68
7.3.250.0120.00616.51
7.3.240.0180.00416.50
7.3.230.0030.01616.55
7.3.210.0160.00616.53
7.3.200.0100.00719.39
7.3.190.0030.00216.54
7.3.180.0100.00716.68
7.3.170.0060.00916.57
7.3.160.0060.01016.55
7.3.120.0060.00914.99
7.2.330.0000.01816.63
7.2.320.0140.00716.79
7.2.310.0180.00316.80
7.2.300.0090.00916.84
7.2.290.0110.01116.75
7.2.00.0000.01519.49
7.1.200.0270.00815.62
7.1.100.0040.01118.25
7.1.70.0000.00716.98
7.1.60.0030.02119.29
7.1.50.0070.01317.02
7.1.00.0030.08022.51
7.0.200.0140.00716.63
7.0.140.0130.06322.02
7.0.110.0000.08720.09
7.0.100.0100.08320.06
7.0.90.0070.05020.06
7.0.80.0070.03720.06
7.0.70.0070.04320.11
7.0.60.0070.04720.11
7.0.50.0100.08020.31
7.0.40.0130.06720.09
7.0.30.0070.04020.27
7.0.20.0030.04320.22
7.0.10.0130.03320.29
7.0.00.0070.07720.07
5.6.280.0000.07720.88
5.6.260.0200.07020.93
5.6.250.0130.07320.69
5.6.240.0100.05720.90
5.6.230.0070.04020.73
5.6.220.0130.03020.67
5.6.210.0030.04020.76
5.6.200.0030.08021.24
5.6.190.0000.04721.13
5.6.180.0030.04321.23
5.6.170.0000.04321.04
5.6.160.0070.06721.20
5.6.150.0100.04021.32
5.6.140.0030.04021.03
5.6.130.0070.04321.19
5.6.120.0030.04320.99
5.6.110.0000.04720.96
5.6.100.0100.03721.30
5.6.90.0030.04321.18
5.6.80.0000.04020.58
5.6.70.0030.04320.70
5.6.60.0030.04020.36
5.6.50.0000.04720.42
5.6.40.0070.08320.61
5.6.30.0070.03720.34
5.6.20.0000.04320.53
5.6.10.0070.03720.45
5.6.00.0030.04020.54
5.5.380.0030.07020.59
5.5.370.0070.03720.58
5.5.360.0100.03320.39
5.5.350.0100.03720.50
5.5.340.0130.08021.01
5.5.330.0070.08021.00
5.5.320.0070.06321.09
5.5.310.0130.06320.99
5.5.300.0070.08320.82
5.5.290.0100.06021.09
5.5.280.0100.04020.89
5.5.270.0030.04321.02
5.5.260.0030.04321.05
5.5.250.0100.06720.81
5.5.240.0100.03320.38
5.5.230.0000.04720.36
5.5.220.0130.03720.09
5.5.210.0030.04020.23
5.5.200.0170.05320.15
5.5.190.0100.03320.32
5.5.180.0030.05720.41
5.5.160.0070.04020.14
5.5.150.0070.03720.17
5.5.140.0030.04020.33
5.5.130.0070.07720.34
5.5.120.0030.07320.43
5.5.110.0030.06720.42
5.5.100.0070.07720.26
5.5.90.0070.04020.32
5.5.80.0070.07320.27
5.5.70.0100.07720.04
5.5.60.0070.07720.18
5.5.50.0100.07720.31
5.5.40.0000.04720.10
5.5.30.0070.04320.23
5.5.20.0130.07320.22
5.5.10.0170.07320.25
5.5.00.0130.07320.08
5.4.450.0100.03319.68
5.4.440.0070.06719.67
5.4.430.0000.04019.49
5.4.420.0000.04319.40
5.4.410.0100.05019.25
5.4.400.0030.04319.15
5.4.390.0130.03019.24
5.4.380.0000.04019.05
5.4.370.0070.03319.06
5.4.360.0030.03719.08
5.4.350.0000.04719.25
5.4.340.0070.03719.11
5.4.320.0000.04019.10
5.4.310.0070.06719.05
5.4.300.0130.06019.18
5.4.290.0000.08019.08
5.4.280.0100.05019.07
5.4.270.0000.04719.04
5.4.260.0130.06719.17
5.4.250.0030.08019.01
5.4.240.0000.04019.33
5.4.230.0070.07319.01
5.4.220.0030.08319.18
5.4.210.0100.06719.18
5.4.200.0100.06319.24
5.4.190.0030.07719.08
5.4.180.0030.07719.33
5.4.170.0070.08019.34
5.4.160.0100.06719.03
5.4.150.0070.07719.32
5.4.140.0030.07716.39
5.4.130.0100.03716.64
5.4.120.0100.06716.38
5.4.110.0070.07016.50
5.4.100.0070.06316.63
5.4.90.0030.07016.63
5.4.80.0030.07716.65
5.4.70.0100.03716.57
5.4.60.0130.06316.33
5.4.50.0070.06316.38
5.4.40.0030.07716.24
5.4.30.0070.07316.51
5.4.20.0100.07016.38
5.4.10.0230.04016.62
5.4.00.0100.06715.91
5.3.290.0000.04314.69
5.3.280.0100.07014.62
5.3.270.0030.04714.71
5.3.260.0030.07714.59
5.3.250.0030.04714.50
5.3.240.0000.04314.75
5.3.230.0070.06714.73
5.3.220.0070.07014.57
5.3.210.0130.06714.54
5.3.200.0030.05314.70
5.3.190.0070.04314.57
5.3.180.0030.07714.53
5.3.170.0030.05314.49
5.3.160.0100.08014.71
5.3.150.0100.07314.56
5.3.140.0130.06714.64
5.3.130.0070.07314.47
5.3.120.0100.04314.47
5.3.110.0070.07314.47
5.3.100.0030.07714.14
5.3.90.0100.04314.17
5.3.80.0130.06714.11
5.3.70.0070.06013.98
5.3.60.0100.06314.09
5.3.50.0030.07014.06
5.3.40.0130.07014.10
5.3.30.0070.04013.86
5.3.20.0100.06313.61
5.3.10.0070.06713.75
5.3.00.0100.06313.64
5.2.170.0070.03012.90
5.2.160.0030.06712.90
5.2.150.0030.06012.90
5.2.140.0100.05712.90
5.2.130.0030.06312.90
5.2.120.0100.06012.90
5.2.110.0030.05712.90
5.2.100.0100.06312.90
5.2.90.0100.05312.90
5.2.80.0070.06312.90
5.2.70.0100.06012.90
5.2.60.0070.06012.90
5.2.50.0070.03712.90
5.2.40.0100.05712.90
5.2.30.0070.05712.90
5.2.20.0030.06012.90
5.2.10.0030.06012.90
5.2.00.0030.06012.90
5.1.60.0000.03312.90
5.1.50.0030.05712.90
5.1.40.0030.05712.90
5.1.30.0000.06012.90
5.1.20.0070.05312.90
5.1.10.0070.05312.90
5.1.00.0030.03012.90
5.0.50.0070.03712.90
5.0.40.0000.02312.90
5.0.30.0070.02712.90
5.0.20.0030.04312.90
5.0.10.0000.04712.90
5.0.00.0070.05712.90
4.4.90.0030.03312.90
4.4.80.0000.03712.90
4.4.70.0030.03012.90
4.4.60.0000.02012.90
4.4.50.0070.02012.90
4.4.40.0030.05012.90
4.4.30.0000.04012.90
4.4.20.0030.02312.90
4.4.10.0070.03312.90
4.4.00.0030.03012.90
4.3.110.0000.01712.90
4.3.100.0000.01712.90
4.3.90.0030.03312.90
4.3.80.0070.05012.90
4.3.70.0000.03312.90
4.3.60.0000.02712.90
4.3.50.0000.03712.90
4.3.40.0000.05312.90
4.3.30.0000.03312.90
4.3.20.0030.03312.90
4.3.10.0030.03312.90
4.3.00.0030.03712.90

preferences:
46.14 ms | 401 KiB | 5 Q