3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = "/mango|apple|banana/"; $text = "i like banana and apple alot"; echo preg_replace_callback($pattern, function($matches){ $str = $matches[0]; $len = strlen($str); $stars = str_repeat('*', $len-2); return $str[0].$stars.$str[$len-1]; }, $text);

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.0090.00916.61
8.3.50.0100.00921.98
8.3.40.0110.00719.14
8.3.30.0110.00819.11
8.3.20.0040.00420.52
8.3.10.0040.00423.46
8.3.00.0030.00619.63
8.2.180.0150.00718.79
8.2.170.0140.00022.96
8.2.160.0070.00720.33
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0050.00319.85
8.2.110.0060.00322.39
8.2.100.0000.01318.03
8.2.90.0000.00819.37
8.2.80.0000.00818.15
8.2.70.0040.00417.75
8.2.60.0040.00418.00
8.2.50.0040.00418.07
8.2.40.0040.00418.02
8.2.30.0030.00618.02
8.2.20.0030.00517.89
8.2.10.0050.00318.04
8.2.00.0030.00617.86
8.1.280.0120.00625.92
8.1.270.0050.00323.79
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00023.84
8.1.230.0080.00419.19
8.1.220.0030.00517.76
8.1.210.0000.00918.77
8.1.200.0030.00617.48
8.1.190.0080.00017.41
8.1.180.0040.00418.10
8.1.170.0000.01418.68
8.1.160.0030.00621.93
8.1.150.0000.00718.74
8.1.140.0040.00417.53
8.1.130.0000.00717.91
8.1.120.0030.00317.53
8.1.110.0060.00317.53
8.1.100.0050.00317.65
8.1.90.0050.00217.53
8.1.80.0000.00717.58
8.1.70.0000.00717.54
8.1.60.0000.00917.73
8.1.50.0040.00417.69
8.1.40.0000.00717.67
8.1.30.0030.00517.81
8.1.20.0030.00517.70
8.1.10.0040.00417.62
8.1.00.0040.00417.66
8.0.300.0070.00018.77
8.0.290.0040.00417.16
8.0.280.0000.00818.46
8.0.270.0030.00317.21
8.0.260.0070.00016.96
8.0.250.0070.00017.11
8.0.240.0070.00017.08
8.0.230.0030.00517.02
8.0.220.0040.00416.93
8.0.210.0030.00516.92
8.0.200.0030.00317.11
8.0.190.0050.00217.09
8.0.180.0000.00717.04
8.0.170.0030.00517.02
8.0.160.0000.00717.11
8.0.150.0000.00717.01
8.0.140.0000.00817.01
8.0.130.0000.00613.52
8.0.120.0040.00417.04
8.0.110.0040.00417.12
8.0.100.0040.00416.94
8.0.90.0040.00416.87
8.0.80.0080.00617.03
8.0.70.0030.00616.93
8.0.60.0040.00417.09
8.0.50.0040.00416.96
8.0.30.0040.01317.34
8.0.20.0110.00817.40
8.0.10.0080.00017.00
8.0.00.0150.00617.03
7.4.330.0000.00515.02
7.4.320.0000.00616.89
7.4.300.0030.00316.73
7.4.290.0080.00016.82
7.4.280.0070.00316.71
7.4.270.0030.00316.83
7.4.260.0000.00716.72
7.4.250.0070.00016.79
7.4.240.0020.00516.69
7.4.230.0030.00316.66
7.4.220.0070.01016.86
7.4.210.0070.00916.82
7.4.200.0030.00316.86
7.4.190.0040.00416.78
7.4.160.0100.00616.52
7.4.150.0060.01217.40
7.4.140.0160.00517.86
7.4.130.0140.00416.66
7.4.120.0050.01216.85
7.4.110.0070.01116.69
7.4.100.0090.01116.73
7.4.90.0110.00516.90
7.4.80.0070.01319.39
7.4.70.0130.00316.49
7.4.60.0070.01016.70
7.4.50.0040.00416.55
7.4.40.0000.01422.77
7.4.30.0080.00816.71
7.4.00.0100.00715.33
7.3.330.0030.00313.39
7.3.320.0060.00013.51
7.3.310.0050.00216.51
7.3.300.0060.00016.53
7.3.290.0090.00916.54
7.3.280.0170.00316.50
7.3.270.0100.01017.40
7.3.260.0090.01316.65
7.3.250.0120.00616.72
7.3.240.0140.00316.73
7.3.230.0130.00316.77
7.3.210.0170.00016.71
7.3.200.0110.00719.39
7.3.190.0100.00716.60
7.3.180.0160.00616.72
7.3.170.0090.00616.80
7.3.160.0080.00816.81
7.3.120.0100.00715.12
7.3.00.0070.00316.81
7.2.330.0080.01116.89
7.2.320.0130.01316.86
7.2.310.0140.00316.80
7.2.300.0070.01316.80
7.2.290.0030.01816.86
7.2.130.0040.00816.95
7.2.120.0030.01017.11
7.2.110.0030.01417.24
7.2.100.0070.00717.07
7.2.90.0100.00617.19
7.2.80.0060.00917.25
7.2.70.0060.00617.24
7.2.60.0030.00917.08
7.2.50.0040.01117.32
7.2.40.0030.01017.21
7.2.30.0070.00717.26
7.2.20.0070.00317.08
7.2.10.0070.01017.05
7.2.00.0030.01018.45
7.1.250.0030.01016.18
7.1.240.0030.01016.10
7.1.230.0030.00616.11
7.1.220.0000.00915.99
7.1.210.0090.00315.93
7.1.200.0040.01116.07
7.1.190.0060.00615.93
7.1.180.0000.01215.77
7.1.170.0040.00815.95
7.1.160.0030.00916.05
7.1.150.0000.01115.92
7.1.140.0060.00616.06
7.1.130.0030.01015.89
7.1.120.0030.01016.12
7.1.110.0100.00316.02
7.1.100.0080.00517.03
7.1.90.0060.00316.05
7.1.80.0040.00815.95
7.1.70.0000.00916.80
7.1.60.0060.01217.67
7.1.50.0110.01325.56
7.1.40.0090.00015.72
7.1.30.0070.00715.91
7.1.20.0070.00415.92
7.1.10.0030.00915.82
7.1.00.0070.04019.23
7.0.330.0030.01015.31
7.0.320.0060.00315.23
7.0.310.0040.01115.48
7.0.300.0060.00615.49
7.0.290.0040.00815.50
7.0.280.0000.00915.66
7.0.270.0070.00715.50
7.0.260.0030.01315.50
7.0.250.0030.01015.57
7.0.240.0030.00915.81
7.0.230.0080.00515.43
7.0.220.0040.00415.58
7.0.210.0070.00715.49
7.0.200.0090.00416.32
7.0.190.0030.01015.56
7.0.180.0090.00615.62
7.0.170.0030.01315.34
7.0.160.0100.00615.41
7.0.150.0070.00315.38
7.0.140.0020.04118.66
7.0.130.0070.01015.66
7.0.120.0070.00315.48
7.0.110.0050.00515.61
7.0.100.0030.01015.43
7.0.90.0030.01415.45
7.0.80.0100.00715.53
7.0.70.0070.00715.21
7.0.60.0070.04317.74
7.0.50.0090.03916.76
7.0.40.0090.02216.79
7.0.30.0200.03216.81
7.0.20.0140.04816.82
7.0.10.0110.03816.77
7.0.00.0050.02316.71
5.6.380.0060.00614.20
5.6.370.0030.01014.53
5.6.360.0030.00614.24
5.6.350.0040.00414.51
5.6.340.0070.00714.48
5.6.330.0130.00014.59
5.6.320.0060.00614.42
5.6.310.0110.00414.21
5.6.300.0070.00714.41
5.6.290.0030.01014.79
5.6.280.0030.04017.94
5.6.270.0030.00914.58
5.6.260.0100.00314.28
5.6.250.0100.00614.64
5.6.240.0070.00714.44
5.6.230.0030.01014.64
5.6.220.0000.01814.61
5.6.210.0100.03617.64
5.6.200.0110.04016.30
5.6.190.0020.02917.52
5.6.180.0150.04417.38
5.6.170.0150.04117.25
5.6.160.0080.04317.41
5.6.150.0020.03316.32
5.6.140.0080.03816.50
5.6.130.0050.02616.27
5.6.120.0070.02017.69
5.6.110.0050.04617.53
5.6.100.0070.04517.57
5.6.90.0120.04417.83
5.6.80.0080.03817.34
5.6.70.2280.02017.26
5.6.60.0000.01114.27
5.6.50.0080.00314.24
5.6.40.0060.00814.01
5.6.30.0060.00314.56
5.6.20.0030.00714.43
5.6.10.0030.01014.14
5.6.00.0080.00814.19
5.5.380.0030.00711.18
5.5.370.0040.00711.18
5.5.360.0070.00311.18
5.5.350.0040.04915.82
5.5.340.0070.01814.59
5.5.330.0080.04215.76
5.5.320.0180.03715.78
5.5.310.0170.02815.78
5.5.300.0060.02614.56
5.5.290.0090.01714.62
5.5.280.0030.02916.01
5.5.270.0090.04416.07
5.5.260.0070.03515.96
5.5.250.0080.03715.94
5.5.240.0180.03615.68
5.5.230.0070.00311.38
5.5.220.0040.00711.30
5.5.210.0120.00011.18
5.5.200.0030.00711.18
5.5.190.0000.01111.18
5.5.180.0120.00011.34
5.5.170.0070.00311.27
5.5.160.0070.00411.26
5.5.150.0060.00611.18
5.5.140.0070.00311.36
5.5.130.0070.00411.33
5.5.120.0070.00011.27
5.5.110.0070.00411.35
5.5.100.0070.00411.20
5.5.90.0080.00411.18
5.5.80.0060.00611.18
5.5.70.0030.00911.35
5.5.60.0050.00511.18
5.5.50.0000.01011.30
5.5.40.0060.00611.29
5.5.30.0040.00811.18
5.5.20.0000.01011.18
5.5.10.0030.00711.26
5.5.00.0040.00411.18
5.4.450.0100.02215.33
5.4.440.0100.02715.18
5.4.430.0130.02815.45
5.4.420.0130.01815.36
5.4.410.0160.01815.25
5.4.400.0140.04015.20
5.4.390.0090.03215.12
5.4.380.0110.04115.20
5.4.370.0130.02115.16
5.4.360.0120.02315.20
5.4.350.0080.02215.23
5.4.340.0120.02215.12
5.4.330.0000.00911.18
5.4.320.0080.02215.01
5.4.310.0100.02215.04
5.4.300.0110.02115.16
5.4.290.0080.02415.19
5.4.280.0110.02115.20
5.4.270.0110.02015.24
5.4.260.0150.01815.01
5.4.250.0120.02015.21
5.4.240.0170.01715.08
5.4.230.0150.01815.20
5.4.220.0110.02415.20
5.4.210.0090.02715.12
5.4.200.0110.02115.10
5.4.190.0140.02215.08
5.4.180.0120.02215.05
5.4.170.0120.02315.02
5.4.160.0080.02214.98
5.4.150.0120.02015.11
5.4.140.0160.01713.77
5.4.130.0110.02113.74
5.4.120.0090.02113.77
5.4.110.0120.02313.81
5.4.100.0150.03313.72
5.4.90.0120.02413.86
5.4.80.0140.02213.86
5.4.70.0120.02313.76
5.4.60.0110.02013.76
5.4.50.0160.01713.85
5.4.40.0120.01813.80
5.4.30.0120.02513.83
5.4.20.0080.02113.75
5.4.10.0120.01713.85
5.4.00.0110.02113.47
5.3.290.0120.01812.98
5.3.280.0070.02512.88
5.3.270.0100.02212.93
5.3.260.0120.02512.94
5.3.250.0080.02412.90
5.3.240.0120.01912.97
5.3.230.0130.01812.94
5.3.220.0150.02112.95
5.3.210.0150.01812.82
5.3.200.0100.02212.85
5.3.190.0130.03712.85
5.3.180.0150.02012.82
5.3.170.0120.02012.82
5.3.160.0130.01912.90
5.3.150.0140.01812.98
5.3.140.0100.02312.91
5.3.130.0100.02512.81
5.3.120.0120.02712.90
5.3.110.0140.02412.97
5.3.100.0100.02312.61
5.3.90.0070.02512.71
5.3.80.0100.02212.58
5.3.70.0070.02412.60
5.3.60.0150.03412.60
5.3.50.0150.03712.64
5.3.40.0130.02012.58
5.3.30.0080.02312.50
5.3.20.0150.01812.39
5.3.10.0100.03812.38
5.3.00.0120.03812.37
5.2.170.0030.02211.11
5.2.160.0120.01711.08
5.2.150.0130.01711.24
5.2.140.0080.01611.09
5.2.130.0110.02011.16
5.2.120.0080.02511.09
5.2.110.0150.02711.11
5.2.100.0100.02011.09
5.2.90.0080.02011.06
5.2.80.0080.03411.16
5.2.70.0130.02511.06
5.2.60.0100.02711.12
5.2.50.0080.03511.12
5.2.40.0110.01611.09
5.2.30.0100.01811.12
5.2.20.0140.01011.04
5.2.10.0080.01610.98
5.2.00.0110.01310.92
5.1.60.0050.02210.59
5.1.50.0100.02210.59
5.1.40.0060.01510.60
5.1.30.0030.01910.74
5.1.20.0080.01810.69
5.1.10.0100.01710.61
5.1.00.0120.01210.61
5.0.50.0030.01210.59
5.0.40.0030.01310.59
5.0.30.0060.01610.59
5.0.20.0080.00810.59
5.0.10.0020.01410.59
5.0.00.0070.02010.59
4.4.90.0050.00810.59
4.4.80.0030.01910.59
4.4.70.0050.01010.59
4.4.60.0070.01410.59
4.4.50.0060.00810.59
4.4.40.0030.01410.59
4.4.30.0050.00910.59
4.4.20.0050.01010.59
4.4.10.0050.00810.59
4.4.00.0060.01210.59
4.3.110.0050.01310.59
4.3.100.0080.01310.59
4.3.90.0060.01010.59
4.3.80.0030.01510.59
4.3.70.0050.00810.59
4.3.60.0050.00810.59
4.3.50.0030.01110.59
4.3.40.0050.01210.59
4.3.30.0000.01310.59
4.3.20.0030.01210.59
4.3.10.0030.01210.59
4.3.00.0030.01210.59

preferences:
34.44 ms | 401 KiB | 5 Q