3v4l.org

run code in 300+ PHP versions simultaneously
<?php // all keys must be lowercase $keywords_external_path = array( "business analyst là gì" => "business-analyst/", "tài liệu cho business analyst" => "tai-lieu-cho-business-analyst/", "product manager là gì" => "product-manager-la-gi/", "công việc của product manager" => "product-manager-phai-biet-dat-cau-hoi/", "QA là gì" => "qc-la-gi-qa-la-gi/", "QC là gì" => "qc-la-gi-qa-la-gi/", "Kiểm thử phần mềm là gì" => "kiem-thu-phan-mem-ai-lam-chang-duoc/", "Automation QA là gì" => "3-loi-khuyen-giup-ban-nang-cap-su-nghiep-qa/", "Tester là gì" => "tester-thanh-cong/", "kỹ năng của Tester giỏi" => "tester-thanh-cong/", "công việc QA" => "qa-gioi/", "Technical Architect là gì" => "how-to-become-ta/", ); //change the keys to lowercase (support multibyte characters) mb_internal_encoding("UTF-8"); $keywords_external_path = array_combine(array_map('mb_strtolower', array_keys($keywords_external_path)), $keywords_external_path); $data = array( 'post_content' => '"business analyst là gì" => "business-analyst/", "tài liệu cho business analyst" => "tai-lieu-cho-business-analyst/", "product manager là gì" => "product-manager-la-gi/", "công việc của product manager" => "product-manager-phai-biet-dat-cau-hoi/", "QA là gì" => "qc-la-gi-qa-la-gi/", "QC là gì" => "qc-la-gi-qa-la-gi/", "Kiểm thử phần mềm là gì" => "kiem-thu-phan-mem-ai-lam-chang-duoc/", "Automation QA là gì" => "3-loi-khuyen-giup-ban-nang-cap-su-nghiep-qa/", "Tester là gì" => "tester-thanh-cong/", "kỹ năng của Tester giỏi" => "tester-thanh-cong/", "công việc QA" => "qa-gioi/", "Technical Architect là gì" => "how-to-become-ta/"' ); $base = 'http://domain.com/'; // only if this is useful $keywords_external = array_keys($keywords_external_path); rsort($keywords_external); // to quickly discards useless position (if you have many keywords): you can also do the same with the second letter $keywords_first_letter = implode('', array_unique(array_reduce($keywords_external, function ($c, $i) { $c[] = mb_substr($i, 0, 1); return $c; }, []))); $pattern = '~\b(?=['. $keywords_first_letter . '])(?:' . implode('|', $keywords_external) . ')\b~iu'; $result = preg_replace_callback($pattern, function ($m) use ($keywords_external_path, $base) { return '<a href="' . $base . $keywords_external_path[mb_strtolower($m[0])] . '">' . $m[0] . '</a>'; }, $data['post_content']); echo $result;

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.130.0060.00318.63
8.3.120.0000.01119.16
8.3.110.0070.00317.03
8.3.100.0080.00020.60
8.3.90.0160.00017.00
8.3.80.0030.00619.36
8.3.70.0140.00718.68
8.3.60.0030.01618.80
8.3.50.0100.01016.99
8.3.40.0090.00619.06
8.3.30.0040.01218.91
8.3.20.0040.00420.16
8.3.10.0080.00021.90
8.3.00.0050.00321.02
8.2.250.0110.00716.87
8.2.240.0050.00519.23
8.2.230.0000.00820.94
8.2.220.0000.00937.54
8.2.210.0000.00826.77
8.2.200.0090.00018.88
8.2.190.0110.00717.04
8.2.180.0060.00918.81
8.2.170.0070.00722.96
8.2.160.0110.00422.32
8.2.150.0090.00024.18
8.2.140.0030.00524.66
8.2.130.0030.00622.42
8.2.120.0040.00426.35
8.2.110.0060.00322.33
8.2.100.0060.00618.03
8.2.90.0000.00818.34
8.2.80.0040.00419.61
8.2.70.0070.00318.00
8.2.60.0060.00318.05
8.2.50.0050.00318.18
8.2.40.0000.00820.68
8.2.30.0040.00419.46
8.2.20.0040.00418.23
8.2.10.0020.00518.30
8.2.00.0040.00418.23
8.1.300.0030.01518.52
8.1.290.0000.01030.84
8.1.280.0090.00625.92
8.1.270.0070.00724.09
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00623.92
8.1.230.0070.00421.09
8.1.220.0000.00818.03
8.1.210.0040.00419.03
8.1.200.0080.00017.73
8.1.190.0030.00617.72
8.1.180.0030.00618.10
8.1.170.0000.00819.08
8.1.160.0000.00819.26
8.1.150.0030.00520.29
8.1.140.0020.00519.88
8.1.130.0000.00719.19
8.1.120.0000.00717.76
8.1.110.0000.00817.63
8.1.100.0000.00717.71
8.1.90.0030.00717.61
8.1.80.0030.00517.78
8.1.70.0000.00717.65
8.1.60.0000.00817.86
8.1.50.0040.00417.81
8.1.40.0040.00417.77
8.1.30.0060.00317.91
8.1.20.0050.00317.85
8.1.10.0040.00417.82
8.1.00.0000.00817.78
8.0.300.0040.00420.27
8.0.290.0070.00017.25
8.0.280.0070.00018.59
8.0.270.0000.00717.41
8.0.260.0000.00717.24
8.0.250.0050.00317.25
8.0.240.0040.00417.30
8.0.230.0050.00317.34
8.0.220.0030.00317.36
8.0.210.0000.00717.34
8.0.200.0040.00417.41
8.0.190.0000.00917.41
8.0.180.0040.00417.39
8.0.170.0030.00517.33
8.0.160.0040.00417.33
8.0.150.0040.00417.26
8.0.140.0040.00417.26
8.0.130.0000.00613.77
8.0.120.0080.00017.28
8.0.110.0040.00417.27
8.0.100.0040.00417.22
8.0.90.0000.00717.17
8.0.80.0040.01217.25
8.0.70.0040.00417.20
8.0.60.0070.00017.18
8.0.50.0040.00417.19
8.0.30.0120.01017.56
8.0.20.0130.01017.51
8.0.10.0000.00717.18
8.0.00.0100.01416.91
7.4.330.0050.00015.55
7.4.320.0000.00617.03
7.4.300.0030.00316.82
7.4.290.0000.00816.81
7.4.280.0000.00816.83
7.4.270.0030.00316.82
7.4.260.0000.00613.68
7.4.250.0040.00416.99
7.4.240.0040.00417.07
7.4.230.0020.00517.13
7.4.220.0040.01416.99
7.4.210.0090.01217.13
7.4.200.0020.00517.03
7.4.160.0080.00816.91
7.4.150.0070.01417.40
7.4.140.0070.01417.86
7.4.130.0120.00616.74
7.4.120.0080.01117.00
7.4.110.0110.00516.99
7.4.100.0150.00616.92
7.4.90.0070.01116.92
7.4.80.0090.00919.39
7.4.70.0060.01216.84
7.4.60.0100.00717.07
7.4.50.0050.00816.77
7.4.40.0130.00316.84
7.4.30.0000.01816.96
7.4.00.0080.00715.31
7.3.330.0000.00613.83
7.3.320.0000.00513.79
7.3.310.0000.00716.81
7.3.300.0020.00516.73
7.3.290.0080.00816.69
7.3.280.0060.01016.71
7.3.270.0060.01217.40
7.3.260.0120.00616.79
7.3.250.0070.01216.67
7.3.240.0090.00816.76
7.3.230.0190.00316.85
7.3.210.0080.01116.90
7.3.200.0070.01016.73
7.3.190.0060.00916.71
7.3.180.0200.00516.80
7.3.170.0000.01816.61
7.3.160.0070.01016.86
7.3.120.0150.00015.13
7.3.110.0000.01915.28
7.3.100.0000.01314.95
7.3.90.0100.00614.98
7.3.80.0030.01315.02
7.3.70.0000.00915.07
7.3.60.0110.00715.00
7.3.50.0070.00715.26
7.3.40.0140.00315.35
7.3.30.0080.00415.08
7.3.20.0000.01116.83
7.3.10.0090.00617.09
7.3.00.0060.00316.99
7.2.330.0140.00317.02
7.2.320.0150.00917.00
7.2.310.0140.00316.83
7.2.300.0090.01517.01
7.2.290.0060.01517.09
7.2.250.0070.01015.07
7.2.240.0100.00715.00
7.2.230.0070.01015.37
7.2.220.0070.00315.52
7.2.210.0090.00915.51
7.2.200.0000.01415.39
7.2.190.0070.00315.28
7.2.180.0070.01415.59
7.2.170.0040.01515.30
7.2.60.0060.00916.99
7.1.330.0030.01316.02
7.1.320.0030.01316.11
7.1.310.0000.01115.98
7.1.300.0030.01216.13
7.1.290.0040.01116.09
7.1.280.0040.01415.88
7.1.270.0030.00915.99
7.1.260.0100.00716.04
7.1.200.0090.00815.65
7.1.70.0030.01317.44
7.1.60.1030.01733.84
7.1.50.0670.01333.36
7.1.40.0530.01733.00
7.1.30.0500.01033.08
7.1.20.0370.01333.11
7.1.10.0230.01015.04
7.1.00.0200.01315.02
7.0.200.0270.01014.93
7.0.190.0270.01015.33
7.0.180.0400.00714.78
7.0.170.0300.01014.85
7.0.160.0200.01315.05
7.0.150.0270.01714.84
7.0.140.0270.01014.78
7.0.130.0300.01314.87
7.0.120.0300.01715.04
7.0.110.0200.01014.82
7.0.100.0330.01714.94
7.0.90.0270.01014.86
7.0.80.0370.00714.90
7.0.70.0330.01314.77
7.0.60.0270.00714.76
7.0.50.0200.01315.05
7.0.40.0230.01314.97
7.0.30.0170.02015.23
7.0.20.0300.01015.22
7.0.10.0230.01315.09
7.0.00.0230.01315.15

preferences:
28.07 ms | 403 KiB | 5 Q