3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <div> Vがある<br> <div id="body-top" class="content-moki clearfix"> Vがある<br> <span class="headline"> <br> にモデル「V」を入れると、プレビューでエンベットが崩れる<br> <br> <div class="oembed oembed-type-instagram" data-oembed-medialink="https://www.instagram.com/p/B5mtrL3p3XV/" style="margin:10px auto;max-width: 500px;" data-oembed-url="https://api.instagram.com/oembed/?url=https%3A%2F%2Fwww.instagram.com%2Fp%2FB5mtrL3p3XV&format=json&maxwidth=500&width=1" data-oembed-id="B5mtrL3p3XV" data-oembed-options='{"maxwidth":"500","width":true}'> <figure class="moki-embed-instagram"> <img src="https://instagram.com/p/B5mtrL3p3XV/media/?size=l"> <figcaption> <i class="fa fa-instagram icon"></i> </figcaption> </figure> Vがある </div> <br>a </span> V... </div> </div> HTML; $needle = 'V'; $replace = '@CHANGE@'; libxml_use_internal_errors(true); $dom = new DOMDocument('1.0', 'utf-8'); $dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($dom); foreach ($xpath->query("//div[contains(@class, 'oembed')]/text()[contains(.,'$needle')]") as $node) { $node->nodeValue = str_replace($needle, $replace, $node->nodeValue); } echo $dom->saveXML($dom->documentElement);

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.4.140.0130.00918.12
8.4.130.0070.00618.37
8.4.120.0120.00921.12
8.4.110.0080.00219.22
8.4.100.0120.00918.68
8.4.90.0140.00621.00
8.4.80.0130.00719.20
8.4.70.0120.00819.32
8.4.60.0130.00920.99
8.4.50.0110.00519.31
8.4.40.0130.00318.41
8.4.30.0070.01020.82
8.4.20.0190.00320.03
8.4.10.0040.00420.09
8.3.270.0100.01317.43
8.3.260.0150.00517.11
8.3.250.0070.01319.34
8.3.240.0100.00917.29
8.3.230.0120.00917.35
8.3.220.0060.00219.34
8.3.210.0070.00217.40
8.3.200.0040.00517.25
8.3.190.0040.00419.52
8.3.180.0100.00919.46
8.3.170.0090.00917.62
8.3.160.0120.00318.88
8.3.150.0070.01121.31
8.3.140.0100.01017.01
8.3.130.0030.00618.84
8.3.120.0160.00320.90
8.3.110.0030.00617.25
8.3.100.0040.00724.06
8.3.90.0000.00826.77
8.3.80.0050.00519.36
8.3.70.0080.00817.38
8.3.60.0030.01217.25
8.3.50.0110.01023.93
8.3.40.0040.01120.98
8.3.30.0070.01519.25
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.290.0150.00517.43
8.2.280.0060.00318.87
8.2.270.0160.00317.05
8.2.260.0030.00616.98
8.2.250.0080.00017.39
8.2.240.0030.00617.41
8.2.230.0040.00420.94
8.2.220.0030.00637.54
8.2.210.0110.00726.77
8.2.200.0050.00518.88
8.2.190.0040.01317.13
8.2.180.0150.00025.92
8.2.170.0090.01219.61
8.2.160.0040.01122.96
8.2.150.0060.00325.66
8.2.140.0000.00824.66
8.2.130.0070.01126.16
8.2.120.0030.00526.35
8.2.110.0070.00321.50
8.2.100.0110.00518.22
8.2.90.0040.00418.39
8.2.80.0050.00319.71
8.2.70.0090.00018.25
8.2.60.0030.00618.00
8.2.50.0090.00018.13
8.2.40.0090.00019.71
8.2.30.0080.00019.63
8.2.20.0000.00818.47
8.2.10.0080.00019.87
8.2.00.0040.00419.78
8.1.330.0110.00916.68
8.1.320.0080.01118.15
8.1.310.0030.00618.22
8.1.300.0080.00018.80
8.1.290.0030.00730.84
8.1.280.0040.01125.92
8.1.270.0030.00523.99
8.1.260.0050.00328.09
8.1.250.0150.00328.09
8.1.240.0060.00322.84
8.1.230.0070.00421.54
8.1.220.0050.00318.29
8.1.210.0050.00519.41
8.1.200.0060.00317.97
8.1.190.0000.00817.85
8.1.180.0030.00618.18
8.1.170.0000.00919.28
8.1.160.0040.00419.49
8.1.150.0040.00419.30
8.1.140.0000.00719.31
8.1.130.0040.00420.54
8.1.120.0000.00817.89
8.1.110.0040.00417.88
8.1.100.0080.00017.99
8.1.90.0050.00317.88
8.1.80.0040.00418.00
8.1.70.0040.00417.88
8.1.60.0000.00818.01
8.1.50.0070.00317.95
8.1.40.0030.00617.96
8.1.30.0000.00918.11
8.1.20.0000.00818.07
8.1.10.0050.00518.13
8.1.00.0000.00918.06
8.0.300.0040.00420.70
8.0.290.0060.00317.13
8.0.280.0030.00319.02
8.0.270.0000.00817.39
8.0.260.0030.00318.96
8.0.250.0000.00717.53
8.0.240.0080.00017.45
8.0.230.0030.00517.45
8.0.220.0080.00017.38
8.0.210.0030.00317.43
8.0.200.0000.01017.52
8.0.190.0000.00717.44
8.0.180.0050.00317.52
8.0.170.0000.00917.54
8.0.160.0000.00717.47
8.0.150.0040.00417.36
8.0.140.0040.00417.33
8.0.130.0050.00013.88
8.0.120.0040.00417.45
8.0.110.0000.01017.46
8.0.100.0040.00417.26
8.0.90.0040.00417.48
8.0.80.0090.00817.36
8.0.70.0040.00417.44
8.0.60.0000.00917.45
8.0.50.0050.00517.47
8.0.30.0060.01217.73
8.0.20.0140.01317.75
8.0.10.0040.00417.29
8.0.00.0100.01017.14
7.4.330.0050.00015.71
7.4.320.0030.00317.11
7.4.300.0080.00017.13
7.4.290.0040.00417.05
7.4.280.0030.00517.03
7.4.270.0030.00616.95
7.4.260.0030.00313.86
7.4.250.0000.00717.00
7.4.240.0050.00216.99
7.4.230.0030.00617.09
7.4.220.0040.00316.85
7.4.210.0090.00917.04
7.4.200.0040.00417.17
7.4.130.0090.00817.05
7.4.120.0170.00816.90
7.4.110.0130.00417.02
7.4.100.0140.00317.13
7.4.90.0150.00617.04
7.4.80.0090.00919.39
7.4.70.0130.00316.94
7.4.60.0100.00717.07
7.4.50.0090.00616.93
7.4.40.0140.00316.79
7.4.30.0040.01416.74
7.4.20.0060.01517.04
7.4.10.0140.00716.81
7.4.00.0040.01316.88
7.3.330.0020.00516.79
7.3.320.0060.00013.73
7.3.310.0000.00716.87
7.3.300.0030.00316.70
7.3.290.0100.00816.87
7.3.280.0140.00316.75
7.3.260.0200.00316.82
7.3.240.0090.01216.92
7.3.230.0100.00716.77
7.3.210.0130.01017.05
7.3.200.0030.01516.92
7.3.190.0170.00716.95
7.3.180.0030.01316.91
7.3.170.0060.00916.85
7.3.160.0110.00817.06
7.3.150.0070.01016.87
7.3.140.0060.01016.89
7.3.130.0110.00916.79
7.3.120.0060.00916.96
7.3.110.0000.01716.94
7.3.100.0030.01416.76
7.3.90.0030.01516.96
7.3.80.0170.00316.93
7.3.70.0130.00316.83
7.3.60.0120.00416.72
7.3.50.0030.01316.77
7.3.40.0130.00316.93
7.3.30.0030.01316.70
7.3.20.0100.00716.88
7.3.10.0060.01216.74
7.3.00.0050.01316.80
7.2.330.0090.00917.04
7.2.320.0060.01217.20
7.2.310.0060.01016.88
7.2.300.0060.01116.98
7.2.290.0110.00717.26
7.2.280.0090.00916.96
7.2.270.0140.00717.14
7.2.260.0070.01417.08
7.2.250.0100.00516.95
7.2.240.0110.00617.08
7.2.230.0120.00616.95
7.2.220.0120.00817.16
7.2.210.0100.01117.02
7.2.200.0030.01417.08
7.2.190.0140.00317.14
7.2.180.0000.01717.11
7.2.170.0100.00717.00
7.2.160.0060.01117.10
7.2.150.0100.00717.21
7.2.140.0030.01516.99
7.2.130.0090.00917.19
7.2.120.0100.00717.20
7.2.110.0130.00317.34
7.2.100.0160.00617.35
7.2.90.0030.01517.18
7.2.80.0090.00917.15
7.2.70.0060.01217.06
7.2.60.0120.00617.11
7.2.50.0080.00917.21
7.2.40.0150.00317.02
7.2.30.0100.00717.14
7.2.20.0130.00617.25
7.2.10.0030.01317.16
7.2.00.0130.00417.08

preferences:
135.76 ms | 403 KiB | 5 Q