3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument; // We don't want to bother with white spaces $doc->preserveWhiteSpace = false; $doc->strictErrorChecking = false; $doc->recover = true; $doc->loadHTMLFile('https://www.bloomberg.com/quote/USDJPY:CUR'); $xpath = new DOMXPath($doc); $query = "//meta[@itemprop='priceChangePercent']"; $entries = $xpath->query($query); foreach ($entries as $entry) { $result = trim($entry->getAttribute('content')); $ret_ = explode(' ', $result); //make sure every element in the array don't start or end with blank foreach ($ret_ as $key=>$val){ $ret_[$key]=trim($val); } //delete the empty element and the element is blank "\n" "\r" "\t" //I modify this line $ret_ = array_values(array_filter($ret_,deleteBlankInArray)); //echo the last element echo $ret_[0]; } ?>

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.00619.05
8.3.50.0070.01416.85
8.3.40.0000.01519.17
8.3.30.0110.00419.18
8.3.20.0000.00822.26
8.3.10.0040.00422.09
8.3.00.0090.00019.40
8.2.180.0090.00618.66
8.2.170.0140.00022.96
8.2.160.0110.00322.42
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0000.00822.58
8.2.120.0080.00026.35
8.2.110.0060.00622.63
8.2.100.0040.00818.16
8.2.90.0080.00019.58
8.2.80.0030.00617.97
8.2.70.0040.00417.88
8.2.60.0060.00318.28
8.2.50.0080.00018.10
8.2.40.0090.00020.84
8.2.30.0040.00419.56
8.2.20.0060.00318.39
8.2.10.0050.00218.31
8.2.00.0000.00718.33
8.1.280.0120.00325.92
8.1.270.0030.00622.44
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0080.00419.38
8.1.230.0090.00618.02
8.1.220.0060.00317.90
8.1.210.0050.00318.77
8.1.200.0090.00017.60
8.1.190.0040.00417.60
8.1.180.0040.00718.10
8.1.170.0000.00818.90
8.1.160.0030.00719.18
8.1.150.0000.00819.27
8.1.140.0040.00419.85
8.1.130.0030.00319.21
8.1.120.0040.00417.84
8.1.110.0030.00617.71
8.1.100.0000.00717.73
8.1.90.0000.00717.64
8.1.80.0030.00617.66
8.1.70.0000.00717.70
8.1.60.0030.00517.76
8.1.50.0030.00617.86
8.1.40.0030.00517.68
8.1.30.0050.00318.01
8.1.20.0000.00817.93
8.1.10.0080.00017.91
8.1.00.0050.00317.84
8.0.300.0050.00218.77
8.0.290.0070.00417.13
8.0.280.0000.00718.66
8.0.270.0000.00717.45
8.0.260.0080.00017.20
8.0.250.0030.00317.34
8.0.240.0060.00317.19
8.0.230.0070.00017.33
8.0.220.0070.00017.17
8.0.210.0070.00017.23
8.0.200.0030.00317.28
8.0.190.0030.00617.33
8.0.180.0030.00517.20
8.0.170.0060.00317.25
8.0.160.0040.00417.35
8.0.150.0040.00417.24
8.0.140.0000.00717.27
8.0.130.0060.00013.64
8.0.120.0030.00517.07
8.0.110.0000.00717.20
8.0.100.0080.00017.12
8.0.90.0000.00817.32
8.0.80.0100.00517.14
8.0.70.0000.00817.30
8.0.60.0040.00417.18
8.0.50.0040.00417.30
8.0.30.0090.01117.48
8.0.20.0110.00817.40
8.0.10.0080.00017.36
8.0.00.0070.01417.18
7.4.330.0050.00015.55
7.4.320.0050.00216.93
7.4.300.0060.00016.78
7.4.290.0000.00716.80
7.4.280.0040.00416.91
7.4.270.0030.00316.96
7.4.260.0030.00313.61
7.4.250.0000.00716.64
7.4.240.0030.00316.77
7.4.230.0000.00716.91
7.4.220.0030.01716.91
7.4.210.0030.01316.72
7.4.200.0000.00716.77
7.4.160.0060.01116.75
7.4.150.0120.00617.40
7.4.140.0090.00917.86
7.4.130.0140.01416.87
7.4.120.0130.00816.77
7.4.110.0070.01116.64
7.4.100.0080.01216.80
7.4.90.0110.00816.62
7.4.80.0100.01319.39
7.4.70.0030.01316.73
7.4.60.0060.00916.66
7.4.50.0190.00016.46
7.4.40.0100.00716.74
7.4.30.0120.00416.65
7.4.00.0100.00715.24
7.3.330.0030.00313.45
7.3.320.0050.00013.32
7.3.310.0070.00016.47
7.3.300.0040.00316.63
7.3.290.0080.01016.66
7.3.280.0080.00816.59
7.3.270.0100.00817.40
7.3.260.0160.00616.60
7.3.250.0100.01016.60
7.3.240.0090.00816.73
7.3.230.0030.01416.93
7.3.210.0030.01316.60
7.3.200.0060.00916.58
7.3.190.0060.00916.64
7.3.180.0090.01016.78
7.3.170.0060.01016.99
7.3.160.0160.00016.72
7.3.120.0080.01015.10
7.3.110.0050.01314.92
7.3.100.0110.00514.88
7.3.90.0030.00814.96
7.3.80.0040.00814.95
7.3.70.0080.00614.95
7.3.60.0050.00914.92
7.3.50.0060.00914.87
7.3.40.0020.01114.87
7.3.30.0070.00514.77
7.3.20.0030.01016.83
7.3.10.0100.00516.82
7.3.00.0070.00816.68
7.2.330.0110.01516.91
7.2.320.0090.00917.07
7.2.310.0060.00916.75
7.2.300.0100.00716.68
7.2.290.0070.01016.78
7.2.250.0000.01215.36
7.2.240.0060.01115.14
7.2.230.0040.01215.27
7.2.220.0060.00815.23
7.2.210.0080.00815.16
7.2.200.0080.00315.22
7.2.190.0050.01015.21
7.2.180.0090.00715.08
7.2.170.0010.01315.13
7.2.160.0050.01015.06
7.2.150.0100.00816.85
7.2.140.0020.01417.09
7.2.130.0080.01017.10
7.2.120.0090.00917.04
7.2.110.0070.00916.98
7.2.100.0050.01116.95
7.2.90.0070.00716.91
7.2.80.0090.00516.97
7.2.70.0080.00616.94
7.2.60.0210.00417.08
7.2.50.0060.00816.92
7.2.40.0050.01016.99
7.2.30.0050.00916.93
7.2.20.0050.01117.11
7.2.10.0090.00617.05
7.2.00.0080.00717.91
7.1.330.0030.01215.83
7.1.320.0050.01015.92
7.1.310.0060.00815.82
7.1.300.0050.00915.82
7.1.290.0080.00715.78
7.1.280.0060.00815.84
7.1.270.0110.00415.69
7.1.260.0040.01016.01
7.1.250.0070.00316.03
7.1.200.0060.00915.97
7.1.70.0050.00217.35
7.1.60.0730.01733.52
7.1.50.0770.01033.14
7.1.40.0570.01732.98
7.1.30.1130.02033.07
7.1.20.1070.01033.07
7.1.10.0600.01315.02
7.1.00.0700.01015.22
7.0.200.0700.01715.48
7.0.190.0730.00715.13
7.0.180.0430.00714.52
7.0.170.1230.01714.64
7.0.160.0700.00714.91
7.0.150.0770.01014.92
7.0.140.1000.01314.74
7.0.130.0500.00715.02
7.0.120.1300.00715.05
7.0.110.0770.01014.91
7.0.100.0700.01714.73
7.0.90.0600.00715.02
7.0.80.0500.01314.98
7.0.70.0430.01014.80
7.0.60.0500.01314.75
7.0.50.1000.01014.82
7.0.40.0770.01715.15
7.0.30.1130.01014.99
7.0.20.0600.01014.93
7.0.10.0830.01315.05
7.0.00.0700.00315.04

preferences:
57.78 ms | 401 KiB | 5 Q