3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Disable time limit to keep the script running set_time_limit(0); // Domain to start crawling $domain = "http://webdevwonders.com"; // Content to search for existence $content = "google-analytics.com/ga.js"; // Tag in which you look for the content $content_tag = "script"; // Name of the output file $output_file = "analytics_domains.txt"; // Maximum urls to check $max_urls_to_check = 100; $rounds = 0; // Array to hold all domains to check $domain_stack = array(); // Maximum size of domain stack $max_size_domain_stack = 1000; // Hash to hold all domains already checked $checked_domains = array(); // Loop through the domains as long as domains are available in the stack // and the maximum number of urls to check is not reached while ($domain != "" && $rounds < $max_urls_to_check) { $doc = new DOMDocument(); // Get the sourcecode of the domain @$doc->loadHTMLFile($domain); $found = false; // Loop through each found tag of the specified type in the dom // and search for the specified content foreach($doc->getElementsByTagName($content_tag) as $tag) { if (strpos($tag->nodeValue, $content)) { $found = true; break; } } // Add the domain to the checked domains hash $checked_domains[$domain] = $found; // Loop through each "a"-tag in the dom // and add its href domain to the domain stack if it is not an internal link foreach($doc->getElementsByTagName('a') as $link) { $href = $link->getAttribute('href'); if (strpos($href, 'http://') !== false && strpos($href, $domain) === false) { $href_array = explode("/", $href); // Keep the domain stack to the predefined max of domains // and only push domains to the stack that have not been checked yet if (count($domain_stack) < $max_size_domain_stack && $checked_domains["http://".$href_array[2]] === null) { array_push($domain_stack, "http://".$href_array[2]); } }; } // Remove all duplicate urls from stack $domain_stack = array_unique($domain_stack); $domain = $domain_stack[0]; // Remove the assigned domain from domain stack unset($domain_stack[0]); // Reorder the domain stack $domain_stack = array_values($domain_stack); $rounds++; } $found_domains = ""; // Add all domains where the specified search string // has been found to the found domains string foreach ($checked_domains as $key => $value) { if ($value) { $found_domains .= $key."\n"; } } // Write found domains string to specified output file file_put_contents($output_file, $found_domains);

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.0150.00418.93
8.3.50.0070.01222.18
8.3.40.0120.00919.34
8.3.30.0080.00620.54
8.3.20.0040.00420.63
8.3.10.0000.00822.45
8.3.00.0080.00022.84
8.2.180.0090.00916.97
8.2.170.0090.00622.96
8.2.160.0070.00722.60
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0070.00426.16
8.2.120.0070.00318.00
8.2.110.0070.00422.58
8.2.100.0000.01218.28
8.2.90.0090.00019.48
8.2.80.0040.00417.97
8.2.70.0080.00018.00
8.2.60.0040.00718.30
8.2.50.0000.00818.07
8.2.40.0050.00318.52
8.2.30.0040.00418.48
8.2.20.0080.00018.01
8.2.10.0040.00418.06
8.2.00.0030.00718.20
8.1.280.0150.00325.92
8.1.270.0030.00623.99
8.1.260.0090.00026.35
8.1.250.0030.00528.09
8.1.240.0090.00024.17
8.1.230.0090.00317.83
8.1.220.0050.00317.93
8.1.210.0000.00818.77
8.1.200.0090.00017.73
8.1.190.0040.00418.01
8.1.180.0060.00318.10
8.1.170.0080.00019.01
8.1.160.0060.00321.08
8.1.150.0080.00018.87
8.1.140.0000.00817.87
8.1.130.0020.00518.19
8.1.120.0020.00517.68
8.1.110.0090.00017.70
8.1.100.0080.00017.79
8.1.90.0040.00417.75
8.1.80.0030.00617.71
8.1.70.0000.00717.68
8.1.60.0060.00317.85
8.1.50.0000.00817.80
8.1.40.0040.00417.81
8.1.30.0000.00817.84
8.1.20.0040.00417.93
8.1.10.0040.00417.79
8.1.00.0030.00717.54
8.0.300.0000.00818.77
8.0.290.0050.00317.25
8.0.280.0050.00218.74
8.0.270.0000.00717.51
8.0.260.0050.00317.30
8.0.250.0050.00217.28
8.0.240.0060.00317.09
8.0.230.0040.00417.29
8.0.220.0000.00717.07
8.0.210.0000.00717.23
8.0.200.0030.00317.31
8.0.190.0040.00417.30
8.0.180.0040.00417.27
8.0.170.0080.00017.29
8.0.160.0070.00017.13
8.0.150.0000.00717.22
8.0.140.0040.00417.18
8.0.130.0040.00413.77
8.0.120.0080.00017.34
8.0.110.0000.00917.29
8.0.100.0050.00317.16
8.0.90.0040.00417.08
8.0.80.0070.01117.27
8.0.70.0040.00417.09
8.0.60.0080.00017.42
8.0.50.0030.00517.23
8.0.30.0110.00917.41
8.0.20.0190.00417.44
8.0.10.0080.00017.45
8.0.00.0110.01117.15
7.4.330.0030.00315.55
7.4.320.0060.00016.82
7.4.300.0000.00716.83
7.4.290.0030.00316.91
7.4.280.0000.00916.94
7.4.270.0000.00916.78
7.4.260.0000.00613.55
7.4.250.0030.00716.88
7.4.240.0050.00217.02
7.4.230.0040.00317.10
7.4.220.0000.02017.10
7.4.210.0060.00917.01
7.4.200.0060.00316.96
7.4.190.0050.00316.70
7.4.160.0100.01317.21
7.4.150.0180.00317.40
7.4.140.0100.00917.86
7.4.130.0100.01016.94
7.4.120.0110.00816.78
7.4.110.0100.01017.03
7.4.100.0090.00916.83
7.4.90.0110.00816.83
7.4.80.0090.00919.39
7.4.70.0080.01516.97
7.4.60.0120.00616.94
7.4.50.0000.00816.61
7.4.40.0070.00722.77
7.4.30.0090.01016.94
7.4.10.0090.01015.49
7.4.00.0060.01215.30
7.3.330.0000.00613.55
7.3.320.0030.00313.66
7.3.310.0030.00616.68
7.3.300.0000.00716.71
7.3.290.0070.01416.63
7.3.280.0080.01016.70
7.3.270.0030.01617.40
7.3.260.0150.00616.82
7.3.250.0140.00416.82
7.3.240.0120.00916.88
7.3.230.0150.00316.74
7.3.210.0100.01416.69
7.3.200.0080.01419.39
7.3.190.0100.00716.95
7.3.180.0090.00916.77
7.3.170.0060.01516.82
7.3.160.0140.00316.93
7.3.130.0060.01214.99
7.3.120.0080.01015.17
7.3.110.0100.01015.42
7.3.100.0080.00615.14
7.3.90.0100.00515.12
7.3.80.0060.00815.32
7.3.70.0110.00215.15
7.3.60.0050.01314.95
7.3.50.0050.00815.05
7.3.40.0070.00315.15
7.3.30.0070.00815.02
7.3.20.0090.00516.95
7.3.10.0080.00616.80
7.3.00.0050.00916.80
7.2.330.0030.01517.23
7.2.320.0060.01917.09
7.2.310.0140.00717.13
7.2.300.0110.00817.25
7.2.290.0160.01016.82
7.2.260.0150.00715.63
7.2.250.0030.01315.41
7.2.240.0070.01215.38
7.2.230.0090.00615.53
7.2.220.0100.00615.51
7.2.210.0080.00715.17
7.2.200.0090.00515.41
7.2.190.0040.01015.44
7.2.180.0060.01115.38
7.2.170.0100.00315.42
7.2.160.0030.01015.37
7.2.150.0060.00617.32
7.2.140.0070.00717.10
7.2.130.0050.00517.40
7.2.120.0120.00317.16
7.2.110.0000.01517.10
7.2.100.0100.01017.27
7.2.90.0100.00717.40
7.2.80.0080.00317.36
7.2.70.0100.00317.21
7.2.60.0070.00717.29
7.2.50.0110.00517.04
7.2.40.0110.00617.18
7.2.30.0070.00717.38
7.2.20.0000.01317.19
7.2.10.0060.00917.05
7.2.00.0160.00317.23
7.1.330.0060.01016.19
7.1.320.0070.00515.96
7.1.310.0070.00716.31
7.1.300.0030.01115.78
7.1.290.0030.01115.99
7.1.280.0080.00516.12
7.1.270.0040.01116.14
7.1.260.0100.00515.84
7.1.250.0030.00915.95
7.1.240.0060.00916.15
7.1.230.0070.00316.19
7.1.220.0110.00316.22
7.1.210.0040.00816.16
7.1.200.0070.00616.05
7.1.190.0000.01415.79
7.1.180.0080.00316.09
7.1.170.0030.00616.13
7.1.160.0040.00416.11
7.1.150.0040.00816.03
7.1.140.0100.00616.08
7.1.130.0060.00615.95
7.1.120.0070.01015.88
7.1.110.0000.01416.12
7.1.100.0090.00316.24
7.1.90.0060.00616.24
7.1.80.0140.00016.29
7.1.70.0030.00816.65
7.1.60.0130.00517.59
7.1.50.0140.00616.59
7.1.40.0060.00316.11
7.1.30.0090.00615.92
7.1.20.0080.00615.89
7.1.10.0070.00716.18
7.1.00.0050.02019.42
7.0.330.0070.00715.64
7.0.320.0030.00815.69
7.0.310.0070.00415.71
7.0.300.0060.00315.46
7.0.290.0000.01415.88
7.0.280.0000.00815.70
7.0.270.0060.00315.75
7.0.260.0000.01815.71
7.0.250.0060.00315.78
7.0.240.0040.00815.76
7.0.230.0080.00615.65
7.0.220.0040.01215.74
7.0.210.0090.00615.60
7.0.200.0050.00616.37
7.0.190.0000.00915.63
7.0.180.0070.00315.77
7.0.170.0040.01115.76
7.0.160.0070.00315.77
7.0.150.0030.00915.45
7.0.140.0090.03619.20
7.0.130.0090.00615.54
7.0.120.0070.00315.90
7.0.110.0030.01015.83
7.0.100.0070.00715.75
7.0.90.0090.00315.80
7.0.80.0100.04317.90
7.0.70.0070.02718.04
7.0.60.0340.04018.11
7.0.50.0300.04018.10
7.0.40.0160.03216.92
7.0.30.0030.04017.17
7.0.20.0060.04617.06
7.0.10.0080.04317.18
7.0.00.0080.04017.11
5.6.400.0090.00014.79
5.6.390.0060.00914.56
5.6.380.0040.01114.93
5.6.370.0090.00614.96
5.6.360.0000.01314.68
5.6.350.0130.00314.72
5.6.340.0090.00014.67
5.6.330.0130.00014.54
5.6.320.0060.00914.63
5.6.310.0080.00814.63
5.6.300.0070.00714.59
5.6.290.0030.01314.37
5.6.280.0080.04018.31
5.6.270.0060.01214.98
5.6.260.0070.00414.58
5.6.250.0000.00914.64
5.6.240.0040.01014.90
5.6.230.0050.02717.76
5.6.220.0100.03617.83
5.6.210.0100.04517.81
5.6.200.0070.02818.00
5.6.190.0100.02618.11
5.6.180.0100.04518.03
5.6.170.0050.03418.00
5.6.160.0100.03818.20
5.6.150.0100.04618.07
5.6.140.0100.01818.01
5.6.130.0090.02818.07
5.6.120.0130.03918.00
5.6.110.0090.04218.07
5.6.100.0110.04518.02
5.6.90.0090.03218.11
5.6.80.0080.03717.75
5.6.70.0030.03917.81
5.6.60.0060.04217.61
5.6.50.0090.02417.82
5.6.40.0080.03817.81
5.6.30.0070.02717.76
5.6.20.0100.02317.82
5.6.10.0110.03017.84
5.6.00.0080.03517.58
5.5.380.0100.00314.91
5.5.370.0050.03717.83
5.5.360.0020.03317.76
5.5.350.0110.02317.73
5.5.340.0070.03318.09
5.5.330.0120.04217.89
5.5.320.0050.05018.09
5.5.310.0060.04617.74
5.5.300.0030.02717.83
5.5.290.0050.04518.12
5.5.280.0070.03317.85
5.5.270.0070.04717.90
5.5.260.0130.02718.08
5.5.250.0050.03017.77
5.5.240.0030.02917.58
5.5.230.0080.04317.72
5.5.220.0030.04217.44
5.5.210.0030.03317.79
5.5.200.0100.03717.69
5.5.190.0120.03617.74
5.5.180.0100.04217.48
5.5.170.0030.00914.61
5.5.160.0050.04717.65
5.5.150.0080.02317.46
5.5.140.0070.03917.71
5.5.130.0030.02817.60
5.5.120.0120.04517.56
5.5.110.0080.04117.63
5.5.100.0100.03917.30
5.5.90.0020.04617.38
5.5.80.0060.04317.53
5.5.70.0060.04517.39
5.5.60.0060.03817.26
5.5.50.0100.02217.47
5.5.40.0040.02917.59
5.5.30.0070.04217.56
5.5.20.0030.02717.39
5.5.10.0060.04217.30
5.5.00.0110.04117.46
5.4.450.0020.04515.63
5.4.440.0080.04615.74
5.4.430.0070.04015.68
5.4.420.0080.04215.60
5.4.410.0070.02015.60
5.4.400.0020.04615.25
5.4.390.0030.04315.49
5.4.380.0050.04115.21
5.4.370.0140.03215.47
5.4.360.0080.04115.47
5.4.350.0100.04115.30
5.4.340.0060.04415.43
5.4.330.0000.01211.01
5.4.320.0100.03715.30
5.4.310.0090.02415.31
5.4.300.0030.02515.45
5.4.290.0070.03715.45
5.4.280.0050.03515.26
5.4.270.0110.03615.34
5.4.260.0030.04315.11
5.4.250.0030.03015.46
5.4.240.0070.04015.23
5.4.230.0020.02315.21
5.4.220.0080.03815.49
5.4.210.0050.02515.32
5.4.200.0060.02815.49
5.4.190.0030.04515.37
5.4.180.0030.04215.19
5.4.170.0090.03715.22
5.4.160.0080.04115.38
5.4.150.0080.03515.48
5.4.140.0050.02814.06
5.4.130.0050.03314.09
5.4.120.0160.03713.95
5.4.110.0080.02214.14
5.4.100.0050.02014.17
5.4.90.0050.03714.13
5.4.80.0030.02814.06
5.4.70.0070.03814.17
5.4.60.0030.02814.13
5.4.50.0110.03613.91
5.4.40.0030.04414.14
5.4.30.0070.02014.17
5.4.20.0070.03014.19
5.4.10.0130.03314.21
5.4.00.0080.03313.88
5.3.290.0060.04312.94
5.3.280.0040.04212.80
5.3.270.0050.02612.84
5.3.260.0050.02812.73
5.3.250.0050.04012.84
5.3.240.0070.02412.79
5.3.230.0080.03712.76
5.3.220.0050.03312.78
5.3.210.0020.04212.74
5.3.200.0050.04212.85
5.3.190.0090.03812.76
5.3.180.0070.03712.79
5.3.170.0050.03612.71
5.3.160.0060.03512.91
5.3.150.0100.02012.79
5.3.140.0070.04212.88
5.3.130.0030.04012.91
5.3.120.0060.04012.75
5.3.110.0050.02512.75
5.3.100.0040.02712.60
5.3.90.0120.02412.51
5.3.80.0110.03712.38
5.3.70.0090.03512.42
5.3.60.0050.03812.50
5.3.50.0080.03512.45
5.3.40.0070.03912.47
5.3.30.0060.02812.41
5.3.20.0020.04212.35
5.3.10.0120.03312.23
5.3.00.0050.03412.14
5.2.170.0000.07011.50
5.2.160.0130.05311.50
5.2.150.0130.05011.50
5.2.140.0030.06311.50
5.2.130.0070.06011.50
5.2.120.0100.06011.50
5.2.110.0030.04011.50
5.2.100.0070.06011.50
5.2.90.0100.05711.50
5.2.80.0100.05711.50
5.2.70.0070.06011.50
5.2.60.0130.05011.50
5.2.50.0030.06311.50
5.2.40.0070.03311.50
5.2.30.0030.05711.50
5.2.20.0000.05711.50
5.2.10.0070.06311.50
5.2.00.0070.03011.50
5.1.60.0000.05311.50
5.1.50.0030.04011.50
5.1.40.0030.05011.50
5.1.30.0100.03011.50
5.1.20.0030.04711.50
5.1.10.0030.05711.50
5.1.00.0130.04711.50
5.0.50.0030.03311.50
5.0.40.0000.05011.50
5.0.30.0170.05711.50
5.0.20.0000.04311.50
5.0.10.0100.03711.50
5.0.00.0070.06011.50
4.4.90.0070.02711.50
4.4.80.0000.02011.50
4.4.70.0030.02311.50
4.4.60.0070.01711.50
4.4.50.0000.03711.50
4.4.40.0000.06011.50
4.4.30.0030.02311.50
4.4.20.0030.03711.50
4.4.10.0030.03311.50
4.4.00.0000.05711.50
4.3.110.0030.02711.50
4.3.100.0000.03011.50
4.3.90.0030.03011.50
4.3.80.0070.03011.50
4.3.70.0030.03311.50
4.3.60.0070.02711.50
4.3.50.0030.01711.50
4.3.40.0030.03711.50
4.3.30.0000.04711.50
4.3.20.0030.02011.50
4.3.10.0030.02311.50
4.3.00.0000.02011.50

preferences:
46.36 ms | 401 KiB | 5 Q