3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = ' <span id="pass_AwfpSYYUsn" data-id="AwfpSYYUsn" class="pointer unlockFieldChild" data-client="51" data-status="closed"><i class="fa fa-lock"></i> Show</span> <!-- OTHER HTML STUFF --> <span id="pass_DbTD7TjEDX" data-id="DbTD7TjEDX" class="pointer unlockFieldChild" data-client="51" data-status="closed"><i class="fa fa-lock"></i> Show</span> '; $dom = new DOMDocument; $state = libxml_use_internal_errors(true); $dom->loadHTML('<div id="root">' . $content . '</div>'); $xp = new DOMXPath($dom); $nodeList = $xp->query('//span[starts-with(@id, "pass_")]'); foreach ($nodeList as $node) { $idpass = explode('_', $node->getAttribute('id'), 2)[1]; $pw = 'Free sauerkraut for all!'; /* This checks and fills the password, not really relvant to the question */ /* if ($aG->getCanPassword()) { $p = $em->getRepository('AppBundle:PasswordList')->findOneBy(['code' => $idpass]); if ($p !== null) { $pw = $p->getPass(); } }*/ $textNode = $dom->createTextNode('[pass id="' . $idpass . '"]' . $pw . '[/pass]'); $node->parentNode->replaceChild($textNode, $node); } $content = ''; foreach($dom->getElementById('root')->childNodes as $childNode) { $content .= $dom->saveHTML($childNode); } libxml_use_internal_errors($state); echo $content;

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.5.00.0170.00820.41
8.4.150.0010.00114.05
8.4.140.0090.01317.80
8.4.130.0120.00819.16
8.4.120.0100.01124.35
8.4.110.0110.00819.38
8.4.100.0130.00918.25
8.4.90.0100.01120.87
8.4.80.0100.01019.98
8.4.70.0090.00919.87
8.4.60.0070.00222.04
8.4.50.0100.01018.94
8.4.40.0090.00618.14
8.4.30.0140.00618.00
8.4.20.0150.00619.70
8.4.10.0030.00619.72
8.3.280.0120.00918.69
8.3.270.0150.00716.82
8.3.260.0100.00916.90
8.3.250.0050.00319.57
8.3.240.0140.00517.71
8.3.230.0100.00317.31
8.3.220.0100.00819.36
8.3.210.0080.00717.05
8.3.200.0100.00916.94
8.3.190.0110.00817.60
8.3.180.0090.01119.55
8.3.170.0090.00916.98
8.3.160.0050.00319.25
8.3.150.0100.01019.34
8.3.140.0040.00419.50
8.3.130.0060.00318.79
8.3.120.0060.00319.26
8.3.110.0060.00318.93
8.3.100.0030.00624.06
8.3.90.0040.00426.77
8.3.80.0100.00019.36
8.3.70.0130.00918.80
8.3.60.0060.01217.13
8.3.50.0100.01118.77
8.3.40.0090.00919.09
8.3.30.0060.00919.17
8.3.20.0040.00420.54
8.3.10.0040.00422.47
8.3.00.0040.00423.85
8.2.290.0100.01020.88
8.2.280.0090.01117.09
8.2.270.0130.00618.81
8.2.260.0080.00017.17
8.2.250.0040.00416.96
8.2.240.0030.01317.51
8.2.230.0130.00020.94
8.2.220.0060.00337.54
8.2.210.0040.00426.77
8.2.200.0050.00518.88
8.2.190.0100.01017.25
8.2.180.0030.01618.59
8.2.170.0090.00922.96
8.2.160.0140.00720.78
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00422.77
8.2.120.0070.00026.35
8.2.110.0030.00719.89
8.2.100.0100.00318.28
8.2.90.0090.00019.93
8.2.80.0060.00318.43
8.2.70.0040.00418.43
8.2.60.0040.00418.59
8.2.50.0000.00818.53
8.2.40.0080.00021.00
8.2.30.0040.00419.84
8.2.20.0050.00318.68
8.2.10.0040.00418.47
8.2.00.0050.00218.55
8.1.330.0090.00922.21
8.1.320.0160.00416.69
8.1.310.0110.00717.04
8.1.300.0070.01019.02
8.1.290.0090.00030.84
8.1.280.0110.00425.92
8.1.270.0060.00320.69
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0040.00421.25
8.1.230.0040.00719.53
8.1.220.0090.00018.16
8.1.210.0030.00618.77
8.1.200.0040.00717.73
8.1.190.0050.00317.60
8.1.180.0040.00418.10
8.1.170.0030.00519.15
8.1.160.0080.00019.27
8.1.150.0070.00020.57
8.1.140.0050.00317.79
8.1.130.0040.00419.50
8.1.120.0000.00717.89
8.1.110.0030.00517.88
8.1.100.0040.00417.85
8.1.90.0100.00017.87
8.1.80.0030.00517.86
8.1.70.0030.00317.84
8.1.60.0040.00417.86
8.1.50.0000.00817.85
8.1.40.0000.00917.96
8.1.30.0080.00018.09
8.1.20.0050.00317.99
8.1.10.0030.00517.89
8.1.00.0060.00317.86
8.0.300.0000.00720.41
8.0.290.0040.00417.13
8.0.280.0040.00418.84
8.0.270.0070.00017.64
8.0.260.0070.00018.81
8.0.250.0030.00317.41
8.0.240.0030.00517.39
8.0.230.0000.00717.36
8.0.220.0040.00417.32
8.0.210.0030.00317.28
8.0.200.0030.00317.30
8.0.190.0030.00617.33
8.0.180.0040.00417.36
8.0.170.0030.00617.29
8.0.160.0040.00417.27
8.0.150.0030.00917.11
8.0.140.0030.00617.13
8.0.130.0050.00013.73
8.0.120.0000.00717.16
8.0.110.0050.00317.30
8.0.100.0040.00417.14
8.0.90.0000.00817.14
8.0.80.0070.01617.28
8.0.70.0040.00417.09
8.0.60.0000.00817.23
8.0.50.0000.00817.09
8.0.30.0140.00417.40
8.0.20.0120.00717.42
8.0.10.0030.00617.29
8.0.00.0110.00817.14
7.4.330.0000.00515.55
7.4.320.0000.00616.90
7.4.300.0060.00016.95
7.4.290.0040.00216.91
7.4.280.0000.00917.01
7.4.270.0000.00716.82
7.4.260.0000.00716.88
7.4.250.0040.00416.86
7.4.240.0050.00216.77
7.4.230.0000.00817.02
7.4.220.0090.00916.98
7.4.210.0110.00317.03
7.4.200.0000.00816.85
7.4.160.0120.00716.83
7.4.150.0080.01117.40
7.4.140.0100.00917.86
7.4.130.0120.00616.82
7.4.120.0130.00616.92
7.4.110.0140.00416.64
7.4.100.0070.01017.14
7.4.90.0130.00416.90
7.4.80.0040.01219.39
7.4.70.0040.00816.89
7.4.60.0040.01817.03
7.4.50.0090.00616.91
7.4.40.0080.01616.96
7.4.30.0030.02017.09
7.4.00.0000.01115.03
7.3.330.0030.00313.58
7.3.320.0050.00013.49
7.3.310.0020.00516.82
7.3.300.0040.00416.81
7.3.290.0080.01016.70
7.3.280.0110.00516.70
7.3.270.0190.00017.40
7.3.260.0110.01116.86
7.3.250.0070.01016.67
7.3.240.0120.00816.90
7.3.230.0080.01516.95
7.3.210.0100.01016.76
7.3.200.0090.00916.91
7.3.190.0130.00316.76
7.3.180.0030.01516.64
7.3.170.0060.01216.94
7.3.160.0100.00716.86
7.3.10.0130.00316.78
7.3.00.0090.00916.82
7.2.330.0110.00717.19
7.2.320.0190.00317.18
7.2.310.0040.01317.14
7.2.300.0090.00917.00
7.2.290.0130.00316.80
7.2.130.0030.01217.07
7.2.120.0000.01416.87
7.2.110.0060.01017.05
7.2.100.0030.01417.09
7.2.90.0030.01316.95
7.2.80.0000.01517.00
7.2.70.0060.00917.19
7.2.60.0040.00717.24
7.2.50.0030.00717.15
7.2.40.0030.01216.82
7.2.30.0070.01017.14
7.2.20.0070.00717.18
7.2.10.0130.00317.07
7.2.00.0040.01216.98
7.1.250.0040.01116.03
7.1.240.0070.00316.26
7.1.230.0060.01016.04
7.1.220.0030.01015.95
7.1.210.0040.00716.10
7.1.200.0040.00915.79
7.1.190.0030.01415.88
7.1.180.0040.01116.00
7.1.170.0030.01015.93
7.1.160.0000.01415.82
7.1.150.0000.01215.90
7.1.140.0060.00316.04
7.1.130.0040.00815.86
7.1.120.0060.01016.03
7.1.110.0100.00716.22
7.1.100.0120.00816.22
7.1.90.0070.01316.06
7.1.80.0110.00816.11
7.1.70.1940.00715.78
7.1.60.0350.01024.66
7.1.50.0430.00924.51
7.1.40.0170.00724.34
7.1.30.0160.00824.30
7.1.20.0160.00724.53
7.1.10.3500.01115.49
7.1.00.0270.01215.52
7.0.330.0130.00315.64
7.0.320.0070.00715.48
7.0.310.0030.00815.66
7.0.300.0060.00615.52
7.0.290.0070.01015.50
7.0.280.0040.00815.55
7.0.270.0000.01115.55
7.0.260.0000.00915.66
7.0.250.0070.00715.56
7.0.240.0100.01115.84
7.0.230.0410.00515.75
7.0.220.0040.01515.63
7.0.210.0130.01115.34
7.0.200.0070.01315.37
7.0.190.0090.00815.50
7.0.180.0110.00715.09
7.0.170.0070.00914.93
7.0.160.0810.00515.16
7.0.150.0080.00815.11
7.0.140.0110.00915.03
7.0.130.0120.00915.07
7.0.120.0090.01115.14
7.0.110.0110.00815.02
7.0.100.0310.01015.04
7.0.90.4670.00615.23
7.0.80.0130.00815.15
7.0.70.0070.01215.16
7.0.60.0130.00515.12
7.0.50.0720.00715.09
7.0.40.0050.01514.16
7.0.30.0550.01014.40
7.0.20.0170.00714.21
7.0.10.0150.00514.33
7.0.00.0080.01214.17
5.6.380.0090.00314.61

preferences:
34.17 ms | 403 KiB | 5 Q