3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'Showing results [program=for {program} programs|No pogram at all] [province=in {province}] [degree=with degree of {degree}]'; function interpolateString($message, array $context = array()) { $replace = array(); foreach ($context as $key => $val) { $replace['{' . $key . '}'] = $val; } return strtr($message, $replace); } $arrContext = array( 'program' => 'Nursing', 'province' => 'Ontario', 'degree' => '0' ); echo interpolateString($str, $arrContext); $pattern = '/\[.*\]/'; $replacement = '_'; $subject = $str; echo preg_replace($pattern, $replacement, $subject);

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.0150.00618.43
8.3.50.0150.01321.99
8.3.40.0110.00718.95
8.3.30.0120.00319.09
8.3.20.0050.00319.02
8.3.10.0030.00521.13
8.3.00.0050.00221.70
8.2.180.0090.00616.63
8.2.170.0170.00322.96
8.2.160.0100.01020.52
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00421.11
8.2.110.0060.00321.30
8.2.100.0040.00817.97
8.2.90.0080.00018.34
8.2.80.0000.00817.97
8.2.70.0030.00617.50
8.2.60.0030.00517.93
8.2.50.0040.00418.07
8.2.40.0050.00218.28
8.2.30.0000.00920.04
8.2.20.0070.00017.88
8.2.10.0040.00417.94
8.2.00.0090.00017.88
8.1.280.0090.00625.92
8.1.270.0000.00723.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00823.89
8.1.230.0040.00820.76
8.1.220.0030.00617.78
8.1.210.0000.00818.79
8.1.200.0050.00517.22
8.1.190.0030.00517.54
8.1.180.0140.00018.10
8.1.170.0050.00318.77
8.1.160.0050.00218.84
8.1.150.0040.00418.67
8.1.140.0040.00417.60
8.1.130.0000.00717.86
8.1.120.0030.00517.58
8.1.110.0000.00817.57
8.1.100.0000.00717.50
8.1.90.0040.00417.61
8.1.80.0040.00417.59
8.1.70.0060.00317.57
8.1.60.0000.00717.74
8.1.50.0000.00717.64
8.1.40.0040.00417.56
8.1.30.0090.00017.81
8.1.20.0000.00817.82
8.1.10.0030.00617.74
8.1.00.0080.00417.68
8.0.300.0040.00420.04
8.0.290.0020.00517.04
8.0.280.0090.00018.45
8.0.270.0000.00717.16
8.0.260.0040.00416.96
8.0.250.0000.00817.12
8.0.240.0050.00317.16
8.0.230.0040.00416.94
8.0.220.0000.00716.93
8.0.210.0000.00716.94
8.0.200.0000.00717.09
8.0.190.0060.00317.04
8.0.180.0070.00016.97
8.0.170.0040.00417.01
8.0.160.0070.00016.98
8.0.150.0100.00016.98
8.0.140.0000.00716.87
8.0.130.0040.00413.40
8.0.120.0030.00516.89
8.0.110.0000.00916.90
8.0.100.0000.00716.91
8.0.90.0050.00217.04
8.0.80.0060.01216.95
8.0.70.0000.00716.84
8.0.60.0000.00716.86
8.0.50.0060.00316.93
8.0.30.0100.00917.26
8.0.20.0120.00617.47
8.0.10.0000.00817.04
8.0.00.0110.00916.99
7.4.330.0020.00214.99
7.4.320.0030.00316.86
7.4.300.0030.00316.82
7.4.290.0070.00016.72
7.4.280.0050.00516.66
7.4.270.0040.00416.75
7.4.260.0030.00313.52
7.4.250.0080.00016.82
7.4.240.0070.00016.65
7.4.230.0050.00316.84
7.4.220.0030.01316.83
7.4.210.0060.00916.74
7.4.200.0000.00716.84
7.4.190.0000.00716.94
7.4.160.0090.00616.63
7.4.150.0140.00317.40
7.4.140.0060.01317.86
7.4.130.0050.01116.70
7.4.120.0080.00916.73
7.4.110.0080.01116.72
7.4.100.0150.00916.61
7.4.90.0140.00316.52
7.4.80.0100.01019.37
7.4.70.0150.00616.77
7.4.60.0100.00716.68
7.4.50.0080.00016.76
7.4.40.0070.00722.27
7.4.30.0120.00616.62
7.4.00.0030.01315.06
7.3.330.0000.00513.58
7.3.320.0000.00613.26
7.3.310.0080.00016.38
7.3.300.0000.00716.39
7.3.290.0120.00316.57
7.3.280.0050.01316.50
7.3.270.0030.01717.40
7.3.260.0100.00718.24
7.3.250.0130.00616.75
7.3.240.0100.00716.76
7.3.230.0090.00916.89
7.3.210.0100.00616.87
7.3.200.0170.00719.39
7.3.190.0030.01216.61
7.3.180.0100.00516.54
7.3.170.0090.01216.89
7.3.160.0150.00416.52
7.3.120.0110.00415.06
7.3.00.0040.00716.73
7.2.330.0070.01016.79
7.2.320.0130.00316.98
7.2.310.0070.01016.94
7.2.300.0100.00716.82
7.2.290.0030.01416.80
7.2.130.0090.00617.06
7.2.120.0100.00317.03
7.2.110.0030.00617.05
7.2.100.0080.00817.14
7.2.90.0030.01017.10
7.2.80.0000.01116.89
7.2.70.0000.00917.10
7.2.60.0050.00916.97
7.2.50.0060.00616.94
7.2.40.0110.00017.19
7.2.30.0030.01216.88
7.2.20.0030.01217.14
7.2.10.0030.00616.79
7.2.00.0070.00717.08
7.1.250.0060.00316.12
7.1.240.0040.00716.07
7.1.230.0060.00816.08
7.1.220.0070.00315.88
7.1.210.0000.01316.14
7.1.200.0040.00716.16
7.1.190.0050.00515.89
7.1.180.0070.00715.90
7.1.170.0090.00615.85
7.1.160.0060.00316.10
7.1.150.0060.00315.82
7.1.140.0040.00816.02
7.1.130.0100.00015.92
7.1.120.0030.01115.90
7.1.110.0060.00315.84
7.1.100.0070.00715.81
7.1.90.0120.00315.80
7.1.80.0000.00916.09
7.1.70.0020.00716.68
7.1.60.0070.01117.75
7.1.50.0090.00916.55
7.1.40.0040.00416.06
7.1.30.0070.00716.00
7.1.20.0100.00316.13
7.1.10.0070.00415.92
7.1.00.0020.04319.01
7.0.330.0060.00615.44
7.0.320.0030.01215.55
7.0.310.0040.00815.68
7.0.300.0040.00715.57
7.0.290.0030.00615.17
7.0.280.0060.00615.67
7.0.270.0000.01415.52
7.0.260.0090.00315.64
7.0.250.0040.00715.41
7.0.240.0000.01015.76
7.0.230.0100.00315.77
7.0.220.0060.01015.78
7.0.210.0100.00615.67
7.0.200.0000.00816.32
7.0.190.0040.00415.68
7.0.180.0030.00715.59
7.0.170.0070.00715.66
7.0.160.0060.00615.70
7.0.150.0110.00415.44
7.0.140.0070.03318.84
7.0.130.0130.00015.73
7.0.120.0100.00315.68
7.0.110.0000.01515.42
7.0.100.0060.00915.60
7.0.90.0030.00915.69
7.0.80.0000.01415.59
7.0.70.0030.04718.56
7.0.60.0100.03518.62
7.0.50.0070.03018.97
7.0.40.0050.04516.83
7.0.30.0030.04716.87
7.0.20.0070.04316.73
7.0.10.0030.03616.90
7.0.00.0050.04616.88
5.6.380.0080.00614.66
5.6.370.0030.00914.11
5.6.360.0040.00414.42
5.6.350.0000.01214.69
5.6.340.0030.00914.39
5.6.330.0080.00414.37
5.6.320.0030.00614.49
5.6.310.0060.00614.38
5.6.300.0040.00714.28
5.6.290.0040.01114.39
5.6.280.0080.03817.63
5.6.270.0030.01214.36
5.6.260.0030.00614.77
5.6.250.0090.00014.41
5.6.240.0070.00714.43
5.6.230.0060.00614.52
5.6.220.0050.04517.44
5.6.210.0050.04517.62
5.6.200.0060.03617.75
5.6.190.0050.04317.71
5.6.180.0040.03217.81
5.6.170.0050.03917.65
5.6.160.0090.04217.97
5.6.150.0050.04317.55
5.6.140.0080.04317.58
5.6.130.0030.04717.70
5.6.120.0040.04117.76
5.6.110.0030.03517.80
5.6.100.0000.04617.60
5.6.90.0070.04517.54
5.6.80.0050.04017.42
5.6.70.0000.04417.40
5.6.60.0070.03817.28
5.6.50.0050.04617.37
5.6.40.0020.04417.40
5.6.30.0070.04017.41
5.6.20.0070.04217.44
5.6.10.0030.04417.32
5.6.00.0040.03817.42
5.5.380.0040.00911.48
5.5.370.0000.00811.41
5.5.360.0040.03115.73
5.5.350.0050.04215.78
5.5.340.0100.04016.07
5.5.330.0030.04816.05
5.5.320.0020.03516.07
5.5.310.0060.04316.11
5.5.300.0040.04316.12
5.5.290.0040.04216.08
5.5.280.0040.04516.05
5.5.270.0060.04516.18
5.5.260.0060.04516.04
5.5.250.0050.04515.95
5.5.240.0050.03215.70
5.5.230.0050.03915.84
5.5.220.0050.03315.55
5.5.210.0050.04015.79
5.5.200.0000.04115.66
5.5.190.0040.03215.74
5.5.180.0040.02415.61
5.5.170.0040.00411.44
5.5.160.0020.03215.87
5.5.150.0100.03715.79
5.5.140.0050.04415.66
5.5.130.0050.03915.80
5.5.120.0040.04215.67
5.5.110.0070.03915.88
5.5.100.0030.04415.71
5.5.90.0040.04215.70
5.5.80.0070.03815.77
5.5.70.0040.04315.59
5.5.60.0030.04215.73
5.5.50.0030.02215.60
5.5.40.0060.04415.45
5.5.30.0050.04015.53
5.5.20.0050.04115.51
5.5.10.0080.03815.52
5.5.00.0030.03215.72
5.4.450.0040.03915.44
5.4.440.0090.03715.34
5.4.430.0020.04015.35
5.4.420.0060.04015.50
5.4.410.0050.04415.42
5.4.400.0090.03715.32
5.4.390.0010.03515.15
5.4.380.0030.04014.99
5.4.370.0040.03215.25
5.4.360.0070.04014.96
5.4.350.0060.03815.29
5.4.340.0070.03815.25
5.4.330.0030.00311.02
5.4.320.0060.04015.23
5.4.310.0030.04415.12
5.4.300.0080.03515.22
5.4.290.0020.03715.01
5.4.280.0020.04215.13
5.4.270.0070.03515.02
5.4.260.0050.04015.22
5.4.250.0040.03914.88
5.4.240.0000.03815.11
5.4.230.0030.04015.16
5.4.220.0030.03515.14
5.4.210.0060.03214.93
5.4.200.0040.03215.12
5.4.190.0030.04014.94
5.4.180.0020.04515.22
5.4.170.0050.04014.97
5.4.160.0110.03015.21
5.4.150.0020.04315.05
5.4.140.0020.03813.74
5.4.130.0020.02813.87
5.4.120.0040.01713.86
5.4.110.0020.02213.70
5.4.100.0020.02313.86
5.4.90.0070.01813.67
5.4.80.0020.03413.81
5.4.70.0020.03413.62
5.4.60.0040.03713.66
5.4.50.0060.03613.79
5.4.40.0000.03613.66
5.4.30.0070.03513.72
5.4.20.0040.03713.90
5.4.10.0060.03013.82
5.4.00.0050.03413.27
5.3.290.0050.03012.74
5.3.280.0030.04212.76
5.3.270.0020.04212.78
5.3.260.0030.04312.77
5.3.250.0040.02512.79
5.3.240.0030.03012.82
5.3.230.0050.03912.72
5.3.220.0040.02012.79
5.3.210.0020.04212.79
5.3.200.0060.02512.78
5.3.190.0010.02112.79
5.3.180.0040.03712.78
5.3.170.0020.04212.76
5.3.160.0020.03712.80
5.3.150.0030.03812.72
5.3.140.0020.03712.81
5.3.130.0020.03912.71
5.3.120.0050.03312.69
5.3.110.0030.04212.75
5.3.100.0060.03912.54
5.3.90.0070.03312.49
5.3.80.0050.03012.49
5.3.70.0050.04012.51
5.3.60.0000.04412.47
5.3.50.0050.03512.48
5.3.40.0050.03512.50
5.3.30.0030.04012.43
5.3.20.0070.03512.33
5.3.10.0020.03912.35
5.3.00.0000.03912.27
5.2.170.0060.02811.04
5.2.160.0020.03011.04
5.2.150.0050.02811.03
5.2.140.0040.03011.07
5.2.130.0040.02011.06
5.2.120.0020.03210.95
5.2.110.0020.03311.03
5.2.100.0020.02811.06
5.2.90.0030.03010.95
5.2.80.0030.03310.96
5.2.70.0080.01811.03
5.2.60.0080.02510.91
5.2.50.0070.03410.90
5.2.40.0060.03010.92
5.2.30.0000.03510.95
5.2.20.0060.02610.96
5.2.10.0000.03510.86
5.2.00.0040.03010.87
5.1.60.0060.02410.37
5.1.50.0030.03010.49
5.1.40.0030.02410.46
5.1.30.0030.02210.64
5.1.20.0030.02810.68
5.1.10.0000.02610.41
5.1.00.0030.02810.52
5.0.50.0060.0229.77
5.0.40.0030.0229.77
5.0.30.0030.0339.77
5.0.20.0020.0229.77
5.0.10.0000.0219.77
5.0.00.0030.0339.77
4.4.90.0000.0179.77
4.4.80.0020.0179.77
4.4.70.0000.0239.77
4.4.60.0030.0179.77
4.4.50.0000.0209.77
4.4.40.0020.0289.77
4.4.30.0010.0209.77
4.4.20.0020.0159.77
4.4.10.0030.0199.77
4.4.00.0000.0289.77
4.3.110.0000.0209.77
4.3.100.0060.0159.77
4.3.90.0020.0159.77
4.3.80.0030.0239.77
4.3.70.0000.0159.77
4.3.60.0010.0209.77
4.3.50.0010.0209.77
4.3.40.0010.0259.77
4.3.30.0000.0219.77
4.3.20.0000.0229.77
4.3.10.0010.0189.77
4.3.00.0010.0189.77

preferences:
47.77 ms | 401 KiB | 5 Q