3v4l.org

run code in 300+ PHP versions simultaneously
<?php function highlight($needle, $haystack, $respect, $highlightStart, $highlightEnd) { $replacer = static function ($matches) use ($respect, $highlightStart, $highlightEnd) { return $highlightStart . preg_replace('([^' . $respect . ']+)', $highlightEnd . '$0' . $highlightStart, $matches[0]) . $highlightEnd; }; $needle = str_split($needle); foreach ($needle as &$l) { $l = preg_quote($l); } unset($l); $needle = implode('[^' . $respect . ']*', $needle); return preg_replace_callback('(' . $needle . ')', $replacer, $haystack); } echo highlight('1234', '(123) 456-7890', '0-9', '<b>', '</b>');

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.0080.00818.43
8.3.50.0100.01018.11
8.3.40.0070.00719.09
8.3.30.0090.00619.02
8.3.20.0040.00420.34
8.3.10.0030.00521.03
8.3.00.0080.00021.02
8.2.180.0100.00716.63
8.2.170.0070.00722.96
8.2.160.0040.01121.22
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0040.00420.07
8.2.110.0110.00022.43
8.2.100.0140.00417.91
8.2.90.0060.00319.35
8.2.80.0040.00419.32
8.2.70.0060.00317.75
8.2.60.0080.00318.16
8.2.50.0040.00418.10
8.2.40.0040.00422.32
8.2.30.0000.00719.44
8.2.20.0070.00018.19
8.2.10.0050.00318.30
8.2.00.0020.00518.23
8.1.280.0110.00425.92
8.1.270.0070.00022.36
8.1.260.0000.00726.35
8.1.250.0030.00528.09
8.1.240.0030.00622.62
8.1.230.0000.01117.83
8.1.220.0030.00517.74
8.1.210.0080.00018.77
8.1.200.0080.00017.60
8.1.190.0040.00417.60
8.1.180.0000.00818.10
8.1.170.0060.00318.90
8.1.160.0040.00419.03
8.1.150.0000.00818.96
8.1.140.0030.00619.59
8.1.130.0070.00020.95
8.1.120.0000.00717.64
8.1.110.0000.00717.66
8.1.100.0040.00417.63
8.1.90.0000.00717.60
8.1.80.0000.00817.68
8.1.70.0050.00217.66
8.1.60.0040.00417.79
8.1.50.0000.00817.72
8.1.40.0030.00717.64
8.1.30.0000.00717.85
8.1.20.0040.00417.74
8.1.10.0050.00317.64
8.1.00.0030.00617.70
8.0.300.0050.00318.77
8.0.290.0040.00416.88
8.0.280.0030.00318.36
8.0.270.0070.00017.23
8.0.260.0060.00018.92
8.0.250.0070.00017.12
8.0.240.0030.00517.17
8.0.230.0000.00717.13
8.0.220.0040.00417.09
8.0.210.0030.00316.97
8.0.200.0040.00417.13
8.0.190.0060.00317.09
8.0.180.0070.00017.06
8.0.170.0070.00017.09
8.0.160.0070.00017.13
8.0.150.0070.00417.05
8.0.140.0040.00417.06
8.0.130.0030.00313.57
8.0.120.0030.00517.03
8.0.110.0030.00516.94
8.0.100.0050.00216.93
8.0.90.0030.00616.93
8.0.80.0080.00816.95
8.0.70.0040.00416.95
8.0.60.0000.00817.03
8.0.50.0040.00417.07
8.0.30.0130.00417.26
8.0.20.0140.01017.50
8.0.10.0080.00017.02
8.0.00.0110.00716.89
7.4.330.0030.00315.55
7.4.320.0060.00016.73
7.4.300.0000.00616.83
7.4.290.0070.00316.71
7.4.280.0070.00016.86
7.4.270.0050.00216.74
7.4.260.0070.00016.82
7.4.250.0040.00416.74
7.4.240.0080.00016.73
7.4.230.0030.00316.71
7.4.220.0060.01116.71
7.4.210.0070.00816.63
7.4.200.0070.00016.93
7.4.160.0120.00616.70
7.4.150.0110.00617.40
7.4.140.0120.00617.86
7.4.130.0140.00316.85
7.4.120.0120.00816.68
7.4.110.0100.00716.61
7.4.100.0080.01016.70
7.4.90.0070.01016.86
7.4.80.0190.00419.39
7.4.70.0070.01016.70
7.4.60.0060.01116.65
7.4.50.0060.00916.78
7.4.40.0110.00616.81
7.4.30.0070.01116.73
7.4.10.0030.01615.04
7.4.00.0100.00715.10
7.3.330.0000.00513.49
7.3.320.0000.00513.59
7.3.310.0000.00816.43
7.3.300.0000.00716.54
7.3.290.0090.00916.46
7.3.280.0070.01016.46
7.3.270.0070.01417.40
7.3.260.0080.00916.49
7.3.250.0100.00916.62
7.3.240.0070.01116.80
7.3.230.0130.00716.64
7.3.210.0090.00916.66
7.3.200.0100.01116.80
7.3.190.0060.01316.55
7.3.180.0100.00716.77
7.3.170.0030.01316.93
7.3.160.0060.01016.78
7.3.130.0070.01114.89
7.3.120.0030.01415.03
7.3.110.0050.01215.10
7.3.100.0050.00814.96
7.3.90.0080.00714.99
7.3.80.0040.00814.94
7.3.70.0080.00715.02
7.3.60.0070.00714.84
7.3.50.0030.01214.91
7.3.40.0090.00515.06
7.3.30.0030.01114.98
7.3.20.0060.00916.90
7.3.10.0030.00916.84
7.3.00.0080.00816.83
7.2.330.0070.01316.71
7.2.320.0060.01616.89
7.2.310.0030.01417.01
7.2.300.0060.00916.79
7.2.290.0120.00616.82
7.2.260.0090.00915.21
7.2.250.0030.01615.09
7.2.240.0090.00615.40
7.2.230.0070.00815.30
7.2.220.0050.01215.22
7.2.210.0050.00815.18
7.2.200.0050.01014.99
7.2.190.0020.01115.20
7.2.180.0070.00614.92
7.2.170.0070.00815.12
7.2.160.0090.00615.26
7.2.150.0070.00817.07
7.2.140.0060.00817.13
7.2.130.0050.01017.13
7.2.120.0100.00617.20
7.2.110.0070.00717.19
7.2.100.0060.00817.06
7.2.90.0050.01117.00
7.2.80.0070.00917.01
7.2.70.0080.00617.03
7.2.60.0080.00816.99
7.2.50.0060.00817.19
7.2.40.0040.00817.14
7.2.30.0030.01017.09
7.2.20.0090.00617.03
7.2.10.0070.00517.02
7.2.00.0070.00717.09
7.1.330.0030.01315.89
7.1.320.0070.00815.95
7.1.310.0030.00915.83
7.1.300.0080.00616.03
7.1.290.0040.00616.09
7.1.280.0070.00715.95
7.1.270.0050.00516.01
7.1.260.0030.00915.94
7.1.250.0070.00615.77
7.1.240.0030.01016.06
7.1.230.0030.01015.75
7.1.220.0120.00615.84
7.1.210.0040.00816.10
7.1.200.0060.00616.03
7.1.190.0030.00716.00
7.1.180.0040.00415.82
7.1.170.0040.00715.99
7.1.160.0030.00616.08
7.1.150.0090.00616.17
7.1.140.0000.00916.16
7.1.130.0030.01015.86
7.1.120.0070.00715.83
7.1.110.0000.01315.76
7.1.100.0060.00616.05
7.1.90.0060.00615.91
7.1.80.0950.01116.31
7.1.70.1170.01215.94
7.1.60.1040.00524.75
7.1.50.0930.01724.52
7.1.40.0900.00824.42
7.1.30.1020.01324.34
7.1.20.0970.00924.52
7.1.10.1070.00815.55
7.1.00.1120.01315.65
7.0.330.0040.01115.70
7.0.320.0070.00715.43
7.0.310.0060.00615.59
7.0.300.0030.01015.66
7.0.290.0060.00315.73
7.0.280.0110.00315.65
7.0.270.0060.00615.57
7.0.260.0030.01215.45
7.0.250.0150.00015.76
7.0.240.0060.00315.87
7.0.230.0060.00915.61
7.0.220.0060.00615.67
7.0.210.0000.01515.56
7.0.200.0880.00715.48
7.0.190.0950.00515.28
7.0.180.0970.01015.07
7.0.170.1070.00715.19
7.0.160.1270.00714.88
7.0.150.1060.00915.10
7.0.140.1150.00815.28
7.0.130.1110.01215.40
7.0.120.1120.01015.18
7.0.110.1130.01115.13
7.0.100.1190.01015.27
7.0.90.1210.01215.11
7.0.80.1180.00715.30
7.0.70.1090.00615.34
7.0.60.1030.00415.13
7.0.50.1080.01015.32
7.0.40.1190.00914.36
7.0.30.1210.01114.30
7.0.20.1220.00814.37
7.0.10.1000.00714.32
7.0.00.1120.00814.31
5.6.400.0000.00814.39
5.6.390.0000.01414.33
5.6.380.0040.01114.78
5.6.370.0000.01414.90
5.6.360.0070.00714.70
5.6.350.0060.00614.45
5.6.340.0090.00014.27
5.6.330.0070.00314.38
5.6.320.0030.01014.72
5.6.310.0030.01014.28
5.6.300.0060.00614.37
5.6.290.0030.01014.62
5.6.280.0060.00314.55
5.6.270.0070.00314.54
5.6.260.0030.00614.58
5.6.250.0000.00814.52
5.6.240.0060.00314.74
5.6.230.0070.00314.66
5.6.220.0070.00414.35
5.6.210.0070.01014.48
5.6.200.0000.01014.61
5.6.190.0030.01014.27
5.6.180.0090.00614.59
5.6.170.0040.00414.41
5.6.160.0000.01114.52
5.6.150.0000.01414.91
5.6.140.0000.01314.67
5.6.130.0040.01114.56
5.6.120.0060.00614.59
5.6.110.0060.00614.52
5.6.100.0030.00614.30
5.6.90.0000.01314.59
5.6.80.0040.00814.39
5.6.70.0090.00314.44
5.6.60.0000.01714.52
5.6.50.0040.01114.48
5.6.40.0080.00414.26
5.6.30.0000.01314.34
5.6.20.0030.00614.45
5.6.10.0080.00414.13
5.6.00.0030.00614.35

preferences:
61.39 ms | 400 KiB | 5 Q