3v4l.org

run code in 300+ PHP versions simultaneously
<?php class StringHelper { public function interpolate($str, array $context = [], $asIs = false) { $replace = []; foreach ($context as $key => $val) { if ($asIs) { $replace[$key] = $val; } else { $replace['{{' . $key . '}}'] = $val; } } return strtr($str, $replace); } } class CacheKeysDict { protected static $stringHelper = null; const BOT_ACTIVITY_MESSAGES = 'bot_activity_messages'; const PROFILE = 'profile_{{id}}'; public static function prepareKey($key, array $context = []) { return self::getStringHelper()->interpolate($key, $context); } public static function getStringHelper() { if (is_null(self::$stringHelper)) { self::$stringHelper = new StringHelper; } return self::$stringHelper; } } var_dump([ CacheKeysDict::BOT_ACTIVITY_MESSAGES, CacheKeysDict::prepareKey(CacheKeysDict::BOT_ACTIVITY_MESSAGES), CacheKeysDict::prepareKey(CacheKeysDict::PROFILE, ['id' => 503]), ]);

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.40.0040.01118.79
8.3.30.0150.00019.01
8.3.20.0050.00320.29
8.3.10.0040.00420.57
8.3.00.0040.00419.38
8.2.170.0100.01022.96
8.2.160.0100.00320.47
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0020.00526.16
8.2.120.0050.00321.02
8.2.110.0040.00422.17
8.2.100.0070.00417.91
8.2.90.0000.00819.21
8.2.80.0040.00417.97
8.2.70.0050.00317.63
8.2.60.0040.00417.93
8.2.50.0080.00018.07
8.2.40.0040.00418.16
8.2.30.0040.00419.47
8.2.20.0040.00417.70
8.2.10.0000.00818.14
8.2.00.0070.00017.76
8.1.270.0090.00023.80
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0040.00422.12
8.1.230.0040.00718.97
8.1.220.0000.00817.79
8.1.210.0050.00318.77
8.1.200.0000.01117.36
8.1.190.0000.00817.35
8.1.180.0030.00618.10
8.1.170.0030.00618.66
8.1.160.0040.00421.92
8.1.150.0000.00718.79
8.1.140.0000.00817.46
8.1.130.0000.00817.75
8.1.120.0000.00717.54
8.1.110.0000.00817.40
8.1.100.0040.00417.48
8.1.90.0040.00417.49
8.1.80.0040.00417.35
8.1.70.0030.00317.45
8.1.60.0030.00617.59
8.1.50.0030.00617.42
8.1.40.0040.00417.51
8.1.30.0050.00317.68
8.1.20.0000.00717.56
8.1.10.0030.00517.59
8.1.00.0040.00417.60
8.0.300.0050.00318.77
8.0.290.0030.00516.63
8.0.280.0000.00818.41
8.0.270.0030.00317.21
8.0.260.0040.00417.33
8.0.250.0000.00716.85
8.0.240.0000.00717.04
8.0.230.0070.00016.93
8.0.220.0040.00416.91
8.0.210.0000.00716.80
8.0.200.0030.00316.99
8.0.190.0000.00816.96
8.0.180.0000.00716.79
8.0.170.0030.00516.84
8.0.160.0050.00216.98
8.0.150.0080.00016.84
8.0.140.0000.00816.86
8.0.130.0000.00513.38
8.0.120.0030.00616.93
8.0.110.0000.00716.97
8.0.100.0070.00016.87
8.0.90.0000.00716.86
8.0.80.0060.01016.86
8.0.70.0070.00016.85
8.0.60.0040.00416.85
8.0.50.0050.00316.96
8.0.30.0150.00517.12
8.0.20.0120.00717.40
8.0.10.0070.00017.07
8.0.00.0090.01117.03
7.4.330.0000.00515.00
7.4.320.0030.00316.61
7.4.300.0060.00016.47
7.4.290.0030.00316.61
7.4.280.0040.00416.53
7.4.270.0000.00716.61
7.4.260.0080.00016.61
7.4.250.0000.00716.41
7.4.240.0020.00516.62
7.4.230.0030.00316.36
7.4.220.0060.01216.63
7.4.210.0070.00716.53
7.4.200.0030.00316.70
7.4.160.0190.00316.59
7.4.150.0140.00817.40
7.4.140.0150.00317.86
7.4.130.0130.00716.64
7.4.120.0090.01116.61
7.4.110.0070.01016.62
7.4.100.0030.01416.54
7.4.90.0090.00916.61
7.4.80.0040.01419.39
7.4.70.0030.01416.65
7.4.60.0070.01416.66
7.4.50.0060.00316.59
7.4.40.0030.01216.47
7.4.30.0110.00816.64
7.4.10.0100.01015.02
7.4.00.0090.00915.07
7.3.330.0080.00013.20
7.3.320.0040.00413.36
7.3.310.0070.00016.43
7.3.300.0040.00416.41
7.3.290.0090.00616.40
7.3.280.0070.00716.43
7.3.270.0100.00717.40
7.3.260.0150.00816.61
7.3.250.0090.00916.50
7.3.240.0140.00416.68
7.3.230.0180.00316.54
7.3.210.0100.00716.40
7.3.200.0030.01719.39
7.3.190.0160.00616.45
7.3.180.0080.00816.69
7.3.170.0070.01016.73
7.3.160.0030.01316.64
7.3.130.0070.01115.04
7.3.120.0140.00514.74
7.3.110.0110.00515.13
7.3.100.0110.00315.00
7.3.90.0030.01314.72
7.3.80.0050.00914.92
7.3.70.0080.00514.91
7.3.60.0030.00914.84
7.3.50.0050.00814.77
7.3.40.0050.01014.83
7.3.30.0050.00714.73
7.3.20.0040.01116.67
7.3.10.0040.00516.73
7.3.00.0060.00916.69
7.2.330.0090.00916.56
7.2.320.0100.00716.74
7.2.310.0140.00716.55
7.2.300.0130.00316.55
7.2.290.0140.00616.50
7.2.260.0030.01415.03
7.2.250.0060.01314.90
7.2.240.0080.00815.09
7.2.230.0040.01015.20
7.2.220.0060.00615.20
7.2.210.0070.00714.96
7.2.200.0050.00515.13
7.2.190.0050.00714.96
7.2.180.0090.00315.06
7.2.170.0030.01214.90
7.2.160.0000.01515.02
7.2.150.0030.01017.11
7.2.140.0120.00316.98
7.2.130.0120.00117.02
7.2.120.0060.00616.91
7.2.110.0060.00517.06
7.2.100.0040.00916.77
7.2.90.0070.00617.02
7.2.80.0060.00616.82
7.2.70.0070.00716.93
7.2.60.0020.00816.85
7.2.50.0020.01116.94
7.2.40.0070.00317.00
7.2.30.0060.00516.95
7.2.20.0110.00316.91
7.2.10.0050.00716.87
7.2.00.0020.01116.89
7.1.330.0050.01015.56
7.1.320.0030.01215.83
7.1.310.0050.00915.98
7.1.300.0080.00515.80
7.1.290.0090.00515.83
7.1.280.0100.00315.76
7.1.270.0060.00415.91
7.1.260.0060.00615.79
7.1.250.0080.00415.70
7.1.240.0100.00615.84
7.1.230.0060.00615.89
7.1.220.0040.01215.80
7.1.210.0070.00715.54
7.1.200.0030.01015.78
7.1.190.0090.00615.98
7.1.180.0090.00615.76
7.1.170.0030.00815.83
7.1.160.0100.00315.86
7.1.150.0000.01615.55
7.1.140.0040.01115.63
7.1.130.0060.00615.98
7.1.120.0000.01315.54
7.1.110.0090.00616.01
7.1.100.0030.00615.94
7.1.90.0040.00715.74
7.1.80.0030.01015.71
7.1.70.0060.00616.58
7.1.60.0070.00917.74
7.1.50.0020.01216.47
7.1.40.0030.01015.61
7.1.30.0030.00615.93
7.1.20.0040.00815.70
7.1.10.0060.00615.91
7.1.00.0050.03919.16
7.0.330.0000.00815.53
7.0.320.0000.01315.46
7.0.310.0100.00315.43
7.0.300.0000.00815.45
7.0.290.0070.00315.16
7.0.280.0060.00915.32
7.0.270.0030.00915.20
7.0.260.0030.01015.42
7.0.250.0000.00915.44
7.0.240.0040.00815.47
7.0.230.0040.00715.43
7.0.220.0110.00415.61
7.0.210.0100.00315.32
7.0.200.0230.00215.11
7.0.190.0050.00515.29
7.0.180.0070.01015.15
7.0.170.0040.01115.52
7.0.160.0040.00815.50
7.0.150.0080.00415.34
7.0.140.0090.03918.81
7.0.130.0080.00415.48
7.0.120.0090.00615.16
7.0.110.0060.00915.59
7.0.100.0080.02617.67
7.0.90.0100.02217.65
7.0.80.0090.02317.86
7.0.70.0070.03217.84
7.0.60.0080.04017.73
7.0.50.0100.01817.95
7.0.40.0090.02016.83
7.0.30.0040.04016.72
7.0.20.0090.04516.87
7.0.10.0050.04716.91
7.0.00.0050.02516.69
5.6.400.0060.00314.78
5.6.390.0030.00614.88
5.6.380.0090.00614.27
5.6.370.0040.00714.54
5.6.360.0110.00414.35
5.6.350.0060.00914.32
5.6.340.0120.00314.85
5.6.330.0040.01214.86
5.6.320.0040.00714.57
5.6.310.0040.01114.50
5.6.300.0030.01314.43
5.6.290.0040.01414.58
5.6.280.0100.03517.91
5.6.270.0110.00414.56
5.6.260.0000.01214.41
5.6.250.0030.02717.49
5.6.240.0100.03017.56
5.6.230.0050.04317.56
5.6.220.0080.02517.62
5.6.210.0050.03417.62
5.6.200.0050.03017.72
5.6.190.0070.02517.76
5.6.180.0030.04517.82
5.6.170.0060.02317.79
5.6.160.0090.04117.79
5.6.150.0120.04017.84
5.6.140.0050.02717.89
5.6.130.0090.03317.69
5.6.120.0080.04017.74
5.6.110.0070.04017.91
5.6.100.0100.03817.68
5.6.90.0000.05217.73
5.6.80.0080.04117.48
5.6.70.0070.04017.39
5.6.60.0080.03817.33
5.6.50.0060.04517.52
5.6.40.0050.04017.44
5.6.30.0020.03817.53
5.6.20.0120.01817.47
5.6.10.0070.02217.30
5.6.00.0100.02717.50
5.5.380.0050.04517.41
5.5.370.0110.02017.41
5.5.360.0020.03217.34
5.5.350.0050.02217.36
5.5.340.0030.03217.67
5.5.330.0090.02117.70
5.5.320.0080.04317.81
5.5.310.0070.04317.46
5.5.300.0070.04317.57
5.5.290.0080.04117.71
5.5.280.0020.03617.79
5.5.270.0080.02317.55
5.5.260.0070.04717.67
5.5.250.0060.03317.53
5.5.240.0070.03717.31
5.5.230.0030.04517.14
5.5.220.0050.04717.49
5.5.210.0100.04317.24
5.5.200.0080.02517.25
5.5.190.0060.02317.38
5.5.180.0060.02317.33
5.5.170.0070.00714.59
5.5.160.0070.02217.27
5.5.150.0020.02617.40
5.5.140.0120.01817.30
5.5.130.0040.02517.25
5.5.120.0050.02617.40
5.5.110.0050.02417.24
5.5.100.0020.02617.24
5.5.90.0080.02317.24
5.5.80.0070.02317.30
5.5.70.0050.04317.44
5.5.60.0050.03817.31
5.5.50.0090.02517.28
5.5.40.0100.03017.20
5.5.30.0060.02117.18
5.5.20.0030.03217.29
5.5.10.0060.02617.28
5.5.00.0030.02817.28
5.4.450.0060.04415.47
5.4.440.0020.02515.22
5.4.430.0050.02415.33
5.4.420.0090.03015.26
5.4.410.0080.04015.23
5.4.400.0100.03515.13
5.4.390.0060.04015.06
5.4.380.0080.03115.01
5.4.370.0030.04415.11
5.4.360.0050.04015.10
5.4.350.0020.03215.06
5.4.340.0070.02015.28
5.4.330.0040.00410.85
5.4.320.0080.02015.14
5.4.310.0070.02015.10
5.4.300.0000.03015.01
5.4.290.0080.02515.23
5.4.280.0130.01315.29
5.4.270.0030.02115.23
5.4.260.0030.02615.03
5.4.250.0070.01815.36
5.4.240.0020.02115.36
5.4.230.0050.02815.19
5.4.220.0060.03915.21
5.4.210.0070.04115.02
5.4.200.0150.01215.26
5.4.190.0070.02215.24
5.4.180.0080.02015.06
5.4.170.0020.02815.25
5.4.160.0080.01815.29
5.4.150.0030.02415.02
5.4.140.0020.02413.95
5.4.130.0050.02213.93
5.4.120.0050.01913.81
5.4.110.0030.02313.84
5.4.100.0050.01813.79
5.4.90.0020.02213.70
5.4.80.0050.02613.88
5.4.70.0090.01713.68
5.4.60.0090.01913.62
5.4.50.0020.02213.88
5.4.40.0030.02413.88
5.4.30.0020.02613.77
5.4.20.0050.01713.76
5.4.10.0040.02213.71
5.4.00.0070.01613.44
5.3.290.0070.04014.72
5.3.280.0030.03314.61
5.3.270.0000.04014.66
5.3.260.0070.04714.57
5.3.250.0130.03714.57
5.3.240.0000.04014.56
5.3.230.0100.03714.66
5.3.220.0030.03714.55
5.3.210.0100.03314.57
5.3.200.0030.03714.57
5.3.190.0000.06314.51
5.3.180.0070.03314.68
5.3.170.0030.03314.70
5.3.160.0000.06714.65
5.3.150.0070.03714.68
5.3.140.0030.03714.64
5.3.130.0000.04314.47
5.3.120.0000.04014.65
5.3.110.0070.06014.66
5.3.100.0000.04014.15
5.3.90.0070.03314.16
5.3.80.0000.06014.14
5.3.70.0030.03714.14
5.3.60.0000.04014.08
5.3.50.0070.03013.92
5.3.40.0070.03314.01
5.3.30.0000.04313.92
5.3.20.0000.03713.75
5.3.10.0070.06313.58
5.3.00.0070.07013.62
5.2.170.0030.03011.20
5.2.160.0030.03711.00
5.2.150.0070.04011.07
5.2.140.0000.03011.25
5.2.130.0000.03011.15
5.2.120.0030.06311.00
5.2.110.0070.06311.00
5.2.100.0100.05010.98
5.2.90.0030.06311.16
5.2.80.0170.05011.15
5.2.70.0070.03310.98
5.2.60.0130.04311.04
5.2.50.0070.04011.08
5.2.40.0070.05711.05
5.2.30.0070.06010.87
5.2.20.0030.05711.08
5.2.10.0070.04310.96
5.2.00.0030.06010.73
5.1.60.0070.04010.07
5.1.50.0030.0409.88
5.1.40.0000.06010.01
5.1.30.0030.05710.46
5.1.20.0000.04710.48
5.1.10.0100.05010.18
5.1.00.0000.04710.16
5.0.50.0070.0278.63
5.0.40.0000.0308.48
5.0.30.0000.0678.29
5.0.20.0070.0408.29
5.0.10.0100.0378.29
5.0.00.0070.0638.29
4.4.90.0000.0238.29
4.4.80.0000.0208.29
4.4.70.0030.0308.29
4.4.60.0070.0338.29
4.4.50.0000.0378.29
4.4.40.0000.0408.29
4.4.30.0070.0338.29
4.4.20.0000.0238.29
4.4.10.0030.0338.29
4.4.00.0070.0538.29
4.3.110.0000.0338.29
4.3.100.0030.0338.29
4.3.90.0030.0338.29
4.3.80.0000.0578.29
4.3.70.0070.0238.29
4.3.60.0030.0338.29
4.3.50.0070.0238.29
4.3.40.0030.0378.29
4.3.30.0000.0208.29
4.3.20.0030.0308.29
4.3.10.0030.0378.29
4.3.00.0000.0208.29

preferences:
50.54 ms | 400 KiB | 5 Q