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 = 's/\[.*\]/g'; $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.0060.01418.42
8.3.50.0130.00522.05
8.3.40.0120.00618.97
8.3.30.0160.00018.84
8.3.20.0080.00018.73
8.3.10.0040.00421.05
8.3.00.0080.00323.53
8.2.180.0140.00416.73
8.2.170.0070.00722.96
8.2.160.0100.01020.39
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0080.00026.16
8.2.120.0030.00520.96
8.2.110.0070.00322.20
8.2.100.0040.00717.91
8.2.90.0050.00319.17
8.2.80.0050.00318.05
8.2.70.0040.00417.63
8.2.60.0040.00418.16
8.2.50.0050.00318.07
8.2.40.0050.00218.16
8.2.30.0040.00419.86
8.2.20.0070.00017.79
8.2.10.0000.00817.73
8.2.00.0070.00317.80
8.1.270.0110.00423.99
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0110.01122.55
8.1.230.0070.00420.88
8.1.220.0080.00018.77
8.1.210.0030.00618.97
8.1.200.0000.00917.38
8.1.190.0040.00417.63
8.1.180.0030.00518.10
8.1.170.0080.00018.59
8.1.160.0030.00618.86
8.1.150.0000.00818.68
8.1.140.0040.00417.45
8.1.130.0030.00317.79
8.1.120.0040.00417.51
8.1.110.0040.00417.45
8.1.100.0000.00717.38
8.1.90.0040.00417.46
8.1.80.0020.00517.37
8.1.70.0000.00717.46
8.1.60.0060.00417.61
8.1.50.0040.00417.47
8.1.40.0000.00917.44
8.1.30.0060.00317.57
8.1.20.0040.00417.72
8.1.10.0050.00317.48
8.1.00.0000.00717.49
8.0.300.0040.00419.84
8.0.290.0000.00717.18
8.0.280.0030.00318.45
8.0.270.0050.00317.17
8.0.260.0070.00216.87
8.0.250.0000.00717.03
8.0.240.0030.00617.06
8.0.230.0000.00717.07
8.0.220.0000.00717.00
8.0.210.0060.00316.97
8.0.200.0000.00816.95
8.0.190.0030.00516.92
8.0.180.0080.00017.04
8.0.170.0000.00717.03
8.0.160.0040.00317.03
8.0.150.0080.00016.98
8.0.140.0060.00316.88
8.0.130.0030.00313.46
8.0.120.0000.00816.74
8.0.110.0070.00317.02
8.0.100.0040.00416.99
8.0.90.0000.00716.78
8.0.80.0060.00917.02
8.0.70.0000.00816.87
8.0.60.0000.00816.87
8.0.50.0050.00316.77
8.0.30.0100.00817.11
8.0.20.0130.00417.40
8.0.10.0070.00016.95
8.0.00.0090.01016.65
7.4.330.0000.00514.70
7.4.320.0000.00616.65
7.4.300.0030.00316.62
7.4.290.0040.00416.55
7.4.280.0070.00016.63
7.4.270.0050.00316.55
7.4.260.0000.00513.39
7.4.250.0030.00516.36
7.4.240.0030.00316.43
7.4.230.0040.00416.50
7.4.220.0090.00916.65
7.4.210.0070.00916.61
7.4.200.0040.00416.61
7.4.190.0080.00016.70
7.4.160.0060.01016.41
7.4.150.0100.00617.40
7.4.140.0080.01017.86
7.4.130.0080.00716.52
7.4.120.0070.01016.40
7.4.110.0030.01416.56
7.4.100.0090.00916.71
7.4.90.0060.01116.46
7.4.80.0120.00919.37
7.4.70.0030.01416.50
7.4.60.0090.00916.64
7.4.50.0060.00316.14
7.4.40.0040.01422.27
7.4.30.0120.00916.55
7.4.00.0040.01114.95
7.3.330.0020.00213.36
7.3.320.0000.00613.43
7.3.310.0070.00016.54
7.3.300.0060.00016.29
7.3.290.0130.00616.45
7.3.280.0090.00816.43
7.3.270.0070.01017.40
7.3.260.0110.00618.24
7.3.250.0110.00616.47
7.3.240.0100.00516.44
7.3.230.0110.00616.49
7.3.210.0110.01116.57
7.3.200.0130.00319.39
7.3.190.0100.01016.37
7.3.180.0130.00916.62
7.3.170.0130.00316.41
7.3.160.0110.00416.41
7.3.120.0030.01414.91
7.3.10.0100.00716.15
7.3.00.0130.00616.63
7.2.330.0130.00316.66
7.2.320.0110.00716.27
7.2.310.0120.01216.45
7.2.300.0120.00416.55
7.2.290.0000.02416.34
7.2.130.0100.00716.79
7.2.120.0140.00316.81
7.2.110.0100.01016.60
7.2.100.0110.00716.74
7.2.90.0070.00716.73
7.2.80.0090.00916.79
7.2.70.0040.00916.85
7.2.60.0030.01416.52
7.2.50.0120.00316.63
7.2.40.0100.01016.73
7.2.30.0090.00616.62
7.2.20.0160.00016.59
7.2.10.0000.01616.46
7.2.00.0020.01318.01
7.1.250.0090.00315.97
7.1.240.0070.01015.30
7.1.230.0040.00815.40
7.1.220.0070.00715.31
7.1.210.0080.00615.69
7.1.200.0090.00615.27
7.1.190.0060.01315.59
7.1.180.0130.00615.75
7.1.170.0120.00615.58
7.1.160.0060.01315.73
7.1.150.0140.00415.51
7.1.140.0130.00715.64
7.1.130.0110.00715.55
7.1.120.0150.00615.66
7.1.110.0140.00315.46
7.1.100.0030.00816.76
7.1.90.0130.00715.71
7.1.80.0080.00815.79
7.1.70.0030.00716.34
7.1.60.0140.01117.43
7.1.50.0130.01216.13
7.1.40.0100.00715.55
7.1.30.0170.00715.38
7.1.20.0150.00715.47
7.1.10.0150.00715.69
7.1.00.0070.04318.96
7.0.330.0150.00415.45
7.0.320.0120.00314.85
7.0.310.0100.00315.18
7.0.300.0080.00815.51
7.0.290.0030.00915.35
7.0.280.0070.01015.12
7.0.270.0100.00715.60
7.0.260.0030.01215.20
7.0.250.0070.01115.61
7.0.240.0090.00915.44
7.0.230.0120.00615.31
7.0.220.0080.00615.43
7.0.210.0130.00315.16
7.0.200.0070.00716.10
7.0.190.0110.00715.40
7.0.180.0080.00815.20
7.0.170.0130.00714.79
7.0.160.0080.00815.43
7.0.150.0100.00615.27
7.0.140.0070.04018.67
7.0.130.0070.00715.25
7.0.120.0120.00615.53
7.0.110.0370.03717.55
7.0.100.0360.04217.54
7.0.90.0290.04717.74
7.0.80.0400.03817.58
7.0.70.0270.04017.53
7.0.60.0250.04717.63
7.0.50.0330.04417.99
7.0.40.0040.03216.83
7.0.30.0080.03816.72
7.0.20.0070.04716.69
7.0.10.0080.04216.74
7.0.00.0080.03716.70
5.6.380.0070.01014.21
5.6.370.0090.00614.07
5.6.360.0080.00514.22
5.6.350.0030.01214.25
5.6.340.0060.00914.39
5.6.330.0040.01114.28
5.6.320.0080.00614.25
5.6.310.0000.01314.06
5.6.300.0060.00314.49
5.6.290.0040.00414.32
5.6.280.0040.04017.59
5.6.270.0040.00714.66
5.6.260.0120.03917.34
5.6.250.0050.04717.30
5.6.240.0100.04617.55
5.6.230.0070.04517.45
5.6.220.0030.04217.51
5.6.210.0090.03617.34
5.6.200.0090.03517.57
5.6.190.0080.02917.64
5.6.180.0090.04117.61
5.6.170.0050.02917.86
5.6.160.0020.03917.81
5.6.150.0120.04017.70
5.6.140.0120.04017.63
5.6.130.0060.03817.56
5.6.120.0050.04417.67
5.6.110.0070.03817.42
5.6.100.0110.04017.74
5.6.90.0040.04617.59
5.6.80.0080.04017.33
5.6.70.0110.03517.24
5.6.60.0050.04617.24
5.6.50.0070.04417.23
5.6.40.0080.03917.13
5.6.30.0090.04117.21
5.6.20.0070.04017.33
5.6.10.0100.04017.30
5.6.00.0070.04317.32
5.5.380.0110.03615.88
5.5.370.0080.04215.70
5.5.360.0070.04415.61
5.5.350.0050.04215.70
5.5.340.0070.04215.84
5.5.330.0070.04315.99
5.5.320.0070.03815.72
5.5.310.0050.04215.89
5.5.300.0120.02015.66
5.5.290.0080.04215.85
5.5.280.0070.03915.98
5.5.270.0040.04315.79
5.5.260.0100.04015.82
5.5.250.0070.04215.81
5.5.240.0030.04715.47
5.5.230.0130.03415.55
5.5.220.0110.03915.63
5.5.210.0070.04515.61
5.5.200.0060.04515.67
5.5.190.0070.04315.47
5.5.180.0020.04815.67
5.5.170.0000.00911.24
5.5.160.0070.04015.53
5.5.150.0110.04015.64
5.5.140.0100.02315.45
5.5.130.0020.05115.83
5.5.120.0100.04015.87
5.5.110.0140.03815.86
5.5.100.0160.03415.55
5.5.90.0090.02615.65
5.5.80.0090.03815.67
5.5.70.0100.03715.66
5.5.60.0020.04415.68
5.5.50.0030.02715.69
5.5.40.0110.03815.68
5.5.30.0180.01815.50
5.5.20.0060.04615.51
5.5.10.0030.04515.39
5.5.00.0030.04215.56
5.4.450.0030.04515.31
5.4.440.0050.04415.31
5.4.430.0110.03815.06
5.4.420.0020.05015.21
5.4.410.0090.04014.86
5.4.400.0050.03915.12
5.4.390.0020.03014.95
5.4.380.0130.03815.19
5.4.370.0090.03815.18
5.4.360.0080.02815.13
5.4.350.0090.03814.94
5.4.340.0030.04515.15
5.4.330.0130.00211.19
5.4.320.0080.04015.10
5.4.310.0130.03815.06
5.4.300.0080.03815.05
5.4.290.0140.03915.08
5.4.280.0100.04215.15
5.4.270.0060.04315.32
5.4.260.0040.04215.20
5.4.250.0070.03515.10
5.4.240.0040.04214.89
5.4.230.0070.04215.24
5.4.220.0040.03015.10
5.4.210.0030.03415.11
5.4.200.0110.03515.24
5.4.190.0080.03514.80
5.4.180.0030.03815.01
5.4.170.0110.02315.03
5.4.160.0030.04314.92
5.4.150.0060.03915.05
5.4.140.0050.03913.78
5.4.130.0020.02713.45
5.4.120.0050.04213.69
5.4.110.0030.04313.66
5.4.100.0100.03513.75
5.4.90.0050.03313.82
5.4.80.0050.04313.62
5.4.70.0030.02313.66
5.4.60.0110.03513.55
5.4.50.0050.03513.71
5.4.40.0050.04213.58
5.4.30.0080.03813.63
5.4.20.0070.02513.54
5.4.10.0110.03513.62
5.4.00.0080.04113.25
5.3.290.0100.03912.56
5.3.280.0030.03912.64
5.3.270.0030.04512.66
5.3.260.0030.04412.59
5.3.250.0100.03512.58
5.3.240.0120.03312.54
5.3.230.0030.04212.75
5.3.220.0040.02712.62
5.3.210.0020.02812.49
5.3.200.0050.04112.62
5.3.190.0070.03812.61
5.3.180.0110.03212.75
5.3.170.0030.03912.80
5.3.160.0120.03512.68
5.3.150.0050.03712.69
5.3.140.0070.04012.62
5.3.130.0100.03112.71
5.3.120.0050.03412.72
5.3.110.0110.03712.65
5.3.100.0080.04012.42
5.3.90.0070.03412.29
5.3.80.0050.03512.39
5.3.70.0050.04412.18
5.3.60.0030.04312.27
5.3.50.0050.04012.28
5.3.40.0070.03812.26
5.3.30.0050.04212.28
5.3.20.0050.04112.11
5.3.10.0080.03312.07
5.3.00.0080.03512.01
5.2.170.0060.03111.47
5.2.160.0070.03211.52
5.2.150.0030.03211.50
5.2.140.0080.02211.52
5.2.130.0050.03511.49
5.2.120.0080.01711.43
5.2.110.0070.03211.50
5.2.100.0030.02811.42
5.2.90.0080.01511.49
5.2.80.0070.03211.45
5.2.70.0070.02911.45
5.2.60.0050.03311.42
5.2.50.0030.03011.46
5.2.40.0050.02011.42
5.2.30.0020.03111.42
5.2.20.0030.03511.42
5.2.10.0050.03211.42
5.2.00.0050.02811.42
5.1.60.0080.02311.42
5.1.50.0040.02711.42
5.1.40.0050.03011.42
5.1.30.0050.03011.42
5.1.20.0050.02011.42
5.1.10.0030.02611.42
5.1.00.0030.02811.42
5.0.50.0040.02311.42
5.0.40.0030.02611.42
5.0.30.0090.02811.42
5.0.20.0050.01311.42
5.0.10.0010.01311.42
5.0.00.0040.01711.42
4.4.90.0050.01711.42
4.4.80.0020.02011.42
4.4.70.0020.01611.42
4.4.60.0050.01411.42
4.4.50.0050.01711.42
4.4.40.0090.01311.42
4.4.30.0020.01911.42
4.4.20.0010.01111.42
4.4.10.0000.02011.42
4.4.00.0030.02711.42
4.3.110.0000.01811.42
4.3.100.0020.01011.42
4.3.90.0020.01011.42
4.3.80.0000.01811.42
4.3.70.0000.01211.42
4.3.60.0020.01511.42
4.3.50.0030.00811.42
4.3.40.0000.01511.42
4.3.30.0020.01011.42
4.3.20.0020.01711.42
4.3.10.0030.01011.42
4.3.00.0020.01011.42

preferences:
65.18 ms | 400 KiB | 5 Q