3v4l.org

run code in 300+ PHP versions simultaneously
<?php $desc = '<p> <span style="font-size:12pt;"><strong>Nappe bouton power Samsung Galaxy S6 Edge G925F</strong></span> <br> <span style="font-size:12pt;"><u><i title="bouton power">Nappe Bouton poweR, compatible Samsung Galaxy S6 Edge G925F.</i></u></span> </p>'; canLinkThisWordIn('bouton Power', $desc); function canLinkThisWordIn($word, $html){ $forbidenTagsArray = array('strong', 'a', 'b', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'); $dom = new DOMDocument(); $dom->loadHTML($html); $xpath = new DOMXpath($dom); $wordTags = $xpath->query("//*[text()[contains(translate(., '".strtoupper($word)."', '".strtolower($word)."'), '".strtolower($word)."')]]"); foreach($wordTags as $wordTag){ if(checkTagAndParent($wordTag, $forbidenTagsArray)){ echo "\n".$wordTag->nodeName." == ".$wordTag->nodeValue; } } return false; } function checkTagAndParent($tag, $forbiden){ if(!in_array($tag->tagName, $forbiden)){ if($tag->parentNode){ $parentTags = array_filter(explode("/", preg_replace("/\[[^]]+\]/", "", $tag->getNodePath()))); foreach($parentTags as $parentTag){ if(in_array($parentTag, $forbiden)){ return false; } } } return true; } return false; }

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.0100.01018.73
8.3.50.0190.00318.67
8.3.40.0110.00719.47
8.3.30.0110.00719.20
8.3.20.0000.00722.40
8.3.10.0100.00319.39
8.3.00.0030.00622.60
8.2.180.0110.00418.91
8.2.170.0060.00922.96
8.2.160.0110.00722.71
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0030.00519.77
8.2.120.0050.00326.35
8.2.110.0110.00019.48
8.2.100.0040.00818.22
8.2.90.0030.00519.59
8.2.80.0000.00818.00
8.2.70.0060.00318.00
8.2.60.0060.00318.18
8.2.50.0030.00518.10
8.2.40.0050.00220.83
8.2.30.0040.00419.62
8.2.20.0060.00318.45
8.2.10.0050.00218.48
8.2.00.0040.00418.43
8.1.280.0060.00925.92
8.1.270.0050.00324.21
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0070.01024.19
8.1.230.0120.00018.14
8.1.220.0030.00617.92
8.1.210.0060.00318.77
8.1.200.0090.00017.85
8.1.190.0030.00617.75
8.1.180.0080.00018.10
8.1.170.0030.00519.12
8.1.160.0030.00619.37
8.1.150.0000.00822.44
8.1.140.0070.00019.89
8.1.130.0000.00719.42
8.1.120.0040.00417.92
8.1.110.0030.00518.02
8.1.100.0000.00817.99
8.1.90.0040.00418.00
8.1.80.0040.00417.99
8.1.70.0040.00417.88
8.1.60.0030.00618.04
8.1.50.0070.00317.95
8.1.40.0040.00417.98
8.1.30.0040.00418.08
8.1.20.0080.00018.16
8.1.10.0080.00318.13
8.1.00.0050.00317.96
8.0.300.0070.00018.77
8.0.290.0040.00417.38
8.0.280.0030.00318.84
8.0.270.0000.00717.71
8.0.260.0000.00817.63
8.0.250.0000.00717.36
8.0.240.0070.00317.41
8.0.230.0080.00017.38
8.0.220.0040.00417.32
8.0.210.0000.00717.41
8.0.200.0030.00317.43
8.0.190.0030.00617.48
8.0.180.0040.00417.45
8.0.170.0040.00417.46
8.0.160.0030.00517.47
8.0.150.0050.00217.41
8.0.140.0050.00217.41
8.0.130.0030.00313.95
8.0.120.0000.00917.40
8.0.110.0040.00417.20
8.0.100.0070.00017.27
8.0.90.0070.00017.46
8.0.80.0090.00617.46
8.0.70.0000.00817.58
8.0.60.0040.00417.34
8.0.50.0070.00017.33
8.0.30.0060.01317.92
8.0.20.0130.00817.78
8.0.10.0040.00417.56
8.0.00.0110.00717.36
7.4.330.0050.00015.55
7.4.320.0030.00317.14
7.4.300.0000.00717.27
7.4.290.0030.00317.05
7.4.280.0050.00617.04
7.4.270.0040.00417.21
7.4.260.0040.00417.01
7.4.250.0080.00017.12
7.4.240.0040.00417.13
7.4.230.0040.00416.82
7.4.220.0030.01817.16
7.4.210.0070.00717.22
7.4.200.0000.00717.33
7.4.160.0100.00717.07
7.4.150.0030.01617.40
7.4.140.0100.01017.86
7.4.130.0090.01017.18
7.4.120.0110.00817.02
7.4.110.0110.00717.30
7.4.100.0080.01617.11
7.4.90.0150.00317.17
7.4.80.0090.01519.39
7.4.70.0140.00317.04
7.4.60.0030.01317.12
7.4.50.0070.00717.13
7.4.40.0050.01416.89
7.4.30.0110.00817.14
7.4.00.0060.01015.21
7.3.330.0000.00613.59
7.3.320.0000.00513.64
7.3.310.0070.00016.81
7.3.300.0030.00316.70
7.3.290.0100.00516.73
7.3.280.0070.01116.79
7.3.270.0110.00817.40
7.3.260.0090.00816.88
7.3.250.0090.00816.88
7.3.240.0120.00617.01
7.3.230.0080.00916.91
7.3.210.0090.00916.92
7.3.200.0090.01216.80
7.3.190.0030.01317.08
7.3.180.0110.00717.13
7.3.170.0130.00416.84
7.3.160.0070.01016.97
7.3.120.0060.01315.48
7.3.110.0080.00815.30
7.3.100.0030.01215.29
7.3.90.0090.00314.95
7.3.80.0060.01215.35
7.3.70.0170.00015.29
7.3.60.0070.00415.28
7.3.50.0030.01015.11
7.3.40.0070.01015.17
7.3.30.0040.01415.17
7.3.20.0040.01116.58
7.3.10.0090.00616.97
7.3.00.0050.01016.96
7.2.330.0060.01217.25
7.2.320.0090.01217.13
7.2.310.0040.01417.24
7.2.300.0110.01117.39
7.2.290.0120.00617.15
7.2.250.0060.01315.31
7.2.240.0130.00715.27
7.2.230.0070.01015.41
7.2.220.0070.00415.56
7.2.210.0030.01415.21
7.2.200.0060.01315.39
7.2.190.0070.00715.37
7.2.180.0000.01215.29
7.2.170.0130.00315.30
7.2.130.0070.01017.45
7.2.120.0000.01417.04
7.2.110.0070.00716.97
7.2.100.0060.00617.06
7.2.90.0040.00817.21
7.2.80.0030.01017.08
7.2.70.0130.00317.44
7.2.60.0050.00917.07
7.2.50.0080.00517.21
7.2.40.0140.00017.25
7.2.30.0060.00917.38
7.2.20.0060.00817.29
7.2.10.0030.01017.27
7.2.00.0100.00317.35
7.1.330.0090.00616.14
7.1.320.0000.01116.21
7.1.310.0040.01115.99
7.1.300.0030.01016.23
7.1.290.0100.00716.27
7.1.280.0070.01016.14
7.1.270.0070.00716.26
7.1.260.0000.01116.18
7.1.250.0070.00716.11
7.1.240.0030.01016.13
7.1.230.0060.00616.16
7.1.220.0100.00316.04
7.1.210.0060.00615.90
7.1.200.0040.01016.06
7.1.190.0000.01816.06
7.1.180.0030.01016.06
7.1.170.0070.00416.32
7.1.160.0040.00416.14
7.1.150.0030.00915.99
7.1.140.0030.00716.25
7.1.130.0040.00816.23
7.1.120.0110.00316.11
7.1.110.0070.00716.30
7.1.100.0060.01016.09
7.1.90.0040.01115.98
7.1.80.0040.01115.88
7.1.70.0020.00816.71
7.1.60.0160.00315.92
7.1.50.0070.01116.18
7.1.40.0070.00716.13
7.1.30.0090.00616.02
7.1.20.0030.00616.26
7.1.10.0090.04519.22
7.1.00.0070.03319.26
7.0.330.0000.00915.67
7.0.320.0030.00515.84
7.0.310.0090.00615.65
7.0.300.0030.00515.57
7.0.290.0090.00015.29
7.0.280.0070.00415.75
7.0.270.0040.01115.58
7.0.260.0030.00715.53
7.0.250.0030.01015.61
7.0.240.0090.00315.80
7.0.230.0040.00715.58
7.0.220.0060.00315.47
7.0.210.0090.00315.46
7.0.200.0020.01116.38
7.0.190.0070.00715.80
7.0.180.0080.00515.63
7.0.170.0000.00915.79
7.0.160.0040.01116.02
7.0.150.0080.04418.81
7.0.140.0100.02818.81
7.0.130.0060.03118.76
7.0.120.0090.03118.79
7.0.110.0100.03018.91
7.0.100.0030.03818.94
7.0.90.0070.03518.79
7.0.80.0030.04018.82
7.0.70.0080.02718.90
7.0.60.0020.03718.69
7.0.50.0060.03118.99
7.0.40.0110.02717.94
7.0.30.0150.02517.95
7.0.20.0070.03117.73
7.0.10.0110.02517.91
7.0.00.0030.03517.77
5.6.380.0070.00714.30

preferences:
60.03 ms | 401 KiB | 5 Q