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' => false ); //echo interpolateString($str, $arrContext); echo "\n"; $arrMatches = array(); preg_match_all("/\[(\w+)\=([^\[\]\|.*]*)?\|*([^\[\].*]*)\]/", $str, $arrMatches); for ($i=0; $i<=count($arrMatches[1])-1;$i++) { if ($arrContext[$arrMatches[1][$i]] !== false) { $str = strstr($arrMatches[0][$i], $arrMatches[2][$i]); }else{ $str = strstr($arrMatches[0][$i], $arrMatches[3][$i]); } } echo $str;

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.70.0100.01018.43
8.3.60.0110.00416.88
8.3.50.0050.01122.00
8.3.40.0090.00619.10
8.3.30.0090.00619.12
8.3.20.0060.00320.34
8.3.10.0040.00423.70
8.3.00.0080.00020.82
8.2.190.0140.00018.66
8.2.180.0130.00316.75
8.2.170.0070.01022.96
8.2.160.0070.01322.16
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.73
8.2.110.0030.00622.37
8.2.100.0060.00618.22
8.2.90.0050.00319.53
8.2.80.0040.00417.97
8.2.70.0060.00617.88
8.2.60.0040.00418.05
8.2.50.0000.00818.07
8.2.40.0000.00918.16
8.2.30.0040.00418.14
8.2.20.0050.00317.80
8.2.10.0040.00417.96
8.2.00.0080.00017.95
8.1.280.0100.01025.92
8.1.270.0060.00323.75
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.79
8.1.230.0070.00419.24
8.1.220.0040.00417.91
8.1.210.0030.00518.77
8.1.200.0030.00617.60
8.1.190.0080.00017.66
8.1.180.0040.00418.10
8.1.170.0060.00318.82
8.1.160.0040.00422.09
8.1.150.0040.00418.72
8.1.140.0000.00817.57
8.1.130.0050.00317.82
8.1.120.0050.00317.64
8.1.110.0040.00417.53
8.1.100.0000.00717.70
8.1.90.0040.00417.62
8.1.80.0070.00017.68
8.1.70.0050.00317.55
8.1.60.0050.00317.79
8.1.50.0000.00717.77
8.1.40.0040.00417.71
8.1.30.0000.00817.81
8.1.20.0000.00817.89
8.1.10.0060.00317.63
8.1.00.0000.00817.61
8.0.300.0000.00718.77
8.0.290.0020.00517.30
8.0.280.0050.00218.45
8.0.270.0000.00817.33
8.0.260.0040.00416.93
8.0.250.0080.00017.05
8.0.240.0040.00417.06
8.0.230.0000.00817.10
8.0.220.0000.00717.05
8.0.210.0000.00717.00
8.0.200.0030.00317.14
8.0.190.0000.00717.15
8.0.180.0070.00017.18
8.0.170.0030.00617.00
8.0.160.0000.00717.07
8.0.150.0000.00817.07
8.0.140.0050.00217.07
8.0.130.0000.00613.57
8.0.120.0070.00017.05
8.0.110.0070.00017.18
8.0.100.0040.00417.15
8.0.90.0000.00717.05
8.0.80.0070.01017.07
8.0.70.0070.00016.98
8.0.60.0000.00717.12
8.0.50.0000.00716.91
8.0.30.0090.01117.44
8.0.20.0090.00917.40
8.0.10.0000.00717.07
8.0.00.0090.01016.94
7.4.330.0050.00015.05
7.4.320.0030.00316.79
7.4.300.0040.00416.80
7.4.290.0030.00316.88
7.4.280.0000.00816.86
7.4.270.0030.00316.68
7.4.260.0000.00716.65
7.4.250.0040.00416.85
7.4.240.0030.00416.88
7.4.230.0030.00316.70
7.4.220.0030.01616.85
7.4.210.0090.00816.82
7.4.200.0050.00216.67
7.4.190.0040.00417.04
7.4.160.0070.01116.76
7.4.150.0150.00317.40
7.4.140.0110.00817.86
7.4.130.0100.01216.81
7.4.120.0090.01116.82
7.4.110.0130.01016.78
7.4.100.0060.01716.86
7.4.90.0150.00316.76
7.4.80.0090.00916.79
7.4.70.0030.01216.93
7.4.60.0100.00716.71
7.4.50.0030.00616.74
7.4.40.0040.01122.77
7.4.30.0100.01016.65
7.4.00.0030.01515.42
7.3.330.0050.00013.48
7.3.320.0050.00013.56
7.3.310.0080.00016.48
7.3.300.0030.00316.59
7.3.290.0070.00716.56
7.3.280.0110.00716.55
7.3.270.0140.00317.40
7.3.260.0140.00316.54
7.3.250.0070.00916.74
7.3.240.0190.00316.64
7.3.230.0120.00616.67
7.3.210.0090.00916.88
7.3.200.0090.00919.39
7.3.190.0140.00616.94
7.3.180.0060.01216.85
7.3.170.0200.00316.77
7.3.160.0060.01016.66
7.3.120.0070.00714.77
7.3.00.0030.01216.78
7.2.330.0090.00916.85
7.2.320.0130.00916.85
7.2.310.0030.01516.75
7.2.300.0130.02016.88
7.2.290.0130.00316.82
7.2.130.0130.00316.73
7.2.120.0030.01316.96
7.2.110.0000.01416.92
7.2.100.0110.00416.94
7.2.90.0090.00317.12
7.2.80.0110.00017.10
7.2.70.0060.00917.24
7.2.60.0040.01116.85
7.2.50.0070.01017.16
7.2.40.0070.01017.04
7.2.30.0090.00917.21
7.2.20.0070.01016.92
7.2.10.0060.00917.20
7.2.00.0040.01118.36
7.1.250.0070.00715.71
7.1.240.0100.00315.97
7.1.230.0070.00715.80
7.1.220.0070.00416.17
7.1.210.0040.00715.74
7.1.200.0040.00915.96
7.1.190.0090.00615.82
7.1.180.0100.00316.05
7.1.170.0000.01515.96
7.1.160.0100.00015.99
7.1.150.0060.00915.99
7.1.140.0100.00316.10
7.1.130.0000.01016.03
7.1.120.0070.00716.05
7.1.110.0120.00016.11
7.1.100.0090.00217.13
7.1.90.0040.01415.88
7.1.80.0070.00715.90
7.1.70.0000.01016.59
7.1.60.0070.00917.72
7.1.50.0040.00916.44
7.1.40.0060.00616.21
7.1.30.0070.00415.71
7.1.20.0070.00716.04
7.1.10.0070.00715.82
7.1.00.0050.04219.13
7.0.330.0160.00015.43
7.0.320.0070.00715.36
7.0.310.0090.00615.36
7.0.300.0040.00815.30
7.0.290.0030.01015.64
7.0.280.0090.00615.51
7.0.270.0110.00415.66
7.0.260.0090.00315.37
7.0.250.0060.00615.44
7.0.240.0030.01315.29
7.0.230.0000.01315.68
7.0.220.0090.00615.63
7.0.210.0080.00415.66
7.0.200.0040.00516.19
7.0.190.0080.00015.57
7.0.180.0150.00015.63
7.0.170.0030.01215.37
7.0.160.0000.01415.41
7.0.150.0150.00015.46
7.0.140.0020.04518.84
7.0.130.0030.00715.49
7.0.120.0140.00015.70
7.0.110.0100.00315.41
7.0.100.0110.04017.79
7.0.90.0100.04317.70
7.0.80.0130.04217.64
7.0.70.0070.02617.59
7.0.60.0030.03017.81
7.0.50.0100.03518.11
7.0.40.0020.04816.83
7.0.30.0080.04816.90
7.0.20.0050.04716.75
7.0.10.0070.03216.80
7.0.00.0070.04716.64
5.6.380.0060.00914.24
5.6.370.0150.00014.39
5.6.360.0060.00314.38
5.6.350.0040.01114.23
5.6.340.0030.00614.79
5.6.330.0030.01014.53
5.6.320.0030.00914.36
5.6.310.0060.00614.52
5.6.300.0110.00014.45
5.6.290.0070.00714.51
5.6.280.0020.04017.82
5.6.270.0060.00314.53
5.6.260.0110.00314.53
5.6.250.0050.04217.57
5.6.240.0020.03517.51
5.6.230.0100.03817.67
5.6.220.0030.03317.46
5.6.210.0060.04417.43
5.6.200.0050.04017.65
5.6.190.0050.03917.77
5.6.180.0080.03417.71
5.6.170.0120.02917.65
5.6.160.0100.03517.77
5.6.150.0080.04417.81
5.6.140.0030.04217.63
5.6.130.0050.05017.60
5.6.120.0100.04217.66
5.6.110.0090.02617.68
5.6.100.0030.03317.66
5.6.90.0110.04117.64
5.6.80.0020.04517.46
5.6.70.0090.03017.21
5.6.60.0070.04417.45
5.6.50.0100.04217.55
5.6.40.0130.03517.51
5.6.30.0070.03317.49
5.6.20.0070.03817.29
5.6.10.0090.02817.38
5.6.00.0120.03817.37
5.5.380.0110.03215.91
5.5.370.0060.03815.86
5.5.360.0030.03915.84
5.5.350.0050.04215.95
5.5.340.0070.04416.12
5.5.330.0070.02116.26
5.5.320.0070.04516.11
5.5.310.0050.02716.07
5.5.300.0030.04416.21
5.5.290.0090.04216.05
5.5.280.0050.04216.05
5.5.270.0120.03816.20
5.5.260.0030.02516.05
5.5.250.0030.04115.90
5.5.240.0050.04215.61
5.5.230.0060.04215.68
5.5.220.0140.03515.64
5.5.210.0070.04215.78
5.5.200.0030.04515.59
5.5.190.0070.04215.66
5.5.180.0050.04315.70
5.5.170.0000.01111.18
5.5.160.0050.03015.77
5.5.150.0080.04115.65
5.5.140.0040.04315.64
5.5.130.0050.03815.67
5.5.120.0060.03815.83
5.5.110.0060.03315.76
5.5.100.0080.04315.72
5.5.90.0050.04015.59
5.5.80.0050.04215.63
5.5.70.0110.03615.73
5.5.60.0110.04115.71
5.5.50.0030.04515.67
5.5.40.0060.04115.63
5.5.30.0070.03815.55
5.5.20.0110.02115.71
5.5.10.0070.03115.68
5.5.00.0090.03815.65
5.4.450.0070.04415.31
5.4.440.0150.03715.20
5.4.430.0070.03515.37
5.4.420.0020.02715.42
5.4.410.0050.03915.31
5.4.400.0050.04415.15
5.4.390.0060.04015.27
5.4.380.0040.02815.25
5.4.370.0050.04115.15
5.4.360.0050.03815.01
5.4.350.0050.04515.06
5.4.340.0050.03215.03
5.4.330.0030.00611.18
5.4.320.0050.04015.11
5.4.310.0080.02015.04
5.4.300.0070.03715.10
5.4.290.0040.04315.18
5.4.280.0050.03715.00
5.4.270.0020.03215.18
5.4.260.0070.03715.10
5.4.250.0080.03815.10
5.4.240.0080.04015.17
5.4.230.0070.03815.17
5.4.220.0020.03015.13
5.4.210.0100.03315.13
5.4.200.0090.03815.12
5.4.190.0050.04315.10
5.4.180.0090.02315.15
5.4.170.0110.03515.10
5.4.160.0070.04115.09
5.4.150.0090.03815.12
5.4.140.0060.03813.75
5.4.130.0070.04013.68
5.4.120.0070.04013.82
5.4.110.0070.04213.83
5.4.100.0030.04313.84
5.4.90.0080.03813.75
5.4.80.0100.03713.73
5.4.70.0080.03913.80
5.4.60.0030.03013.82
5.4.50.0070.02213.77
5.4.40.0080.03513.80
5.4.30.0020.03113.82
5.4.20.0000.03513.77
5.4.10.0080.02513.76
5.4.00.0050.04013.62
5.3.290.0020.02412.94
5.3.280.0060.04512.92
5.3.270.0070.03812.87
5.3.260.0050.04112.96
5.3.250.0060.02312.90
5.3.240.0080.02312.89
5.3.230.0070.03812.96
5.3.220.0040.04112.86
5.3.210.0020.02912.93
5.3.200.0030.04012.89
5.3.190.0060.04112.89
5.3.180.0080.02512.88
5.3.170.0050.03712.88
5.3.160.0020.04512.86
5.3.150.0070.03912.86
5.3.140.0070.03012.86
5.3.130.0100.03312.83
5.3.120.0030.04312.89
5.3.110.0010.04112.87
5.3.100.0130.03312.58
5.3.90.0070.03512.59
5.3.80.0030.02812.56
5.3.70.0050.03712.60
5.3.60.0070.03912.55
5.3.50.0100.03512.58
5.3.40.0030.02312.51
5.3.30.0050.03512.50
5.3.20.0020.03412.38
5.3.10.0030.03912.42
5.3.00.0020.02612.44
5.2.170.0030.03111.16
5.2.160.0030.03311.21
5.2.150.0050.02711.09
5.2.140.0080.02711.12
5.2.130.0050.02511.20
5.2.120.0050.02811.18
5.2.110.0000.03511.08
5.2.100.0000.02811.19
5.2.90.0050.02711.17
5.2.80.0020.03411.17
5.2.70.0080.02811.17
5.2.60.0030.03511.14
5.2.50.0040.03311.13
5.2.40.0070.02811.08
5.2.30.0020.03511.13
5.2.20.0070.02711.11
5.2.10.0070.02410.98
5.2.00.0100.02710.99
5.1.60.0020.03310.53
5.1.50.0050.02710.63
5.1.40.0040.02010.61
5.1.30.0010.03410.79
5.1.20.0030.02810.79
5.1.10.0000.03210.55
5.1.00.0000.03310.66
5.0.50.0040.02010.19
5.0.40.0040.02210.19
5.0.30.0010.02010.19
5.0.20.0050.02210.19
5.0.10.0040.02010.19
5.0.00.0000.03410.19
4.4.90.0030.01810.19
4.4.80.0030.01710.19
4.4.70.0020.01510.19
4.4.60.0030.01110.19
4.4.50.0050.01810.19
4.4.40.0030.02010.19
4.4.30.0020.01910.19
4.4.20.0020.02010.19
4.4.10.0020.01310.19
4.4.00.0040.02310.19
4.3.110.0000.01210.19
4.3.100.0030.00710.19
4.3.90.0030.01710.19
4.3.80.0020.02010.19
4.3.70.0020.02210.19
4.3.60.0020.01310.19
4.3.50.0000.02010.19
4.3.40.0020.03010.19
4.3.30.0030.01310.19
4.3.20.0060.01710.19
4.3.10.0030.01810.19
4.3.00.0040.01710.19

preferences:
38.25 ms | 401 KiB | 5 Q