3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface TranslatorInterface { /** * Translates the given message. * * When a number is provided as a parameter named "%count%", the message is parsed for plural * forms and a translation is chosen according to this number using the following rules: * * Given a message with different plural translations separated by a * pipe (|), this method returns the correct portion of the message based * on the given number, locale and the pluralization rules in the message * itself. * * The message supports two different types of pluralization rules: * * interval: {0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples * indexed: There is one apple|There are %count% apples * * The indexed solution can also contain labels (e.g. one: There is one apple). * This is purely for making the translations more clear - it does not * affect the functionality. * * The two methods can also be mixed: * {0} There are no apples|one: There is one apple|more: There are %count% apples * * An interval can represent a finite set of numbers: * {1,2,3,4} * * An interval can represent numbers between two numbers: * [1, +Inf] * ]-1,2[ * * The left delimiter can be [ (inclusive) or ] (exclusive). * The right delimiter can be [ (exclusive) or ] (inclusive). * Beside numbers, you can use -Inf and +Inf for the infinite. * * @see https://en.wikipedia.org/wiki/ISO_31-11 * * @param string $id The message id (may also be an object that can be cast to string) * @param array $parameters An array of parameters for the message * @param string|null $domain The domain for the message or null to use the default * @param string|null $locale The locale or null to use the default * * @return string The translated string * * @throws \InvalidArgumentException If the locale contains invalid characters */ public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null); } final class StubTranslator implements TranslatorInterface { public function trans($id, array $parameters = [], $domain = null, $locale = null): string { return '[trans]'.strtr($id, $parameters).'[/trans]'; } }

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.130.0110.00316.51
8.3.120.0050.00520.54
8.3.110.0060.00316.74
8.3.100.0060.00616.31
8.3.90.0040.00426.77
8.3.80.0090.00017.97
8.3.70.0070.00716.63
8.3.60.0040.01118.56
8.3.50.0050.00924.38
8.3.40.0040.01118.76
8.3.30.0110.00318.54
8.3.20.0040.00420.48
8.3.10.0040.00420.22
8.3.00.0070.00020.70
8.2.250.0000.01416.42
8.2.240.0150.00316.30
8.2.230.0070.00320.94
8.2.220.0000.00924.06
8.2.210.0060.01226.77
8.2.200.0090.00018.29
8.2.190.0100.00316.58
8.2.180.0140.00716.32
8.2.170.0070.00722.96
8.2.160.0100.00322.07
8.2.150.0030.00624.18
8.2.140.0030.00524.66
8.2.130.0080.00026.16
8.2.120.0040.00426.16
8.2.110.0050.00520.35
8.2.100.0030.00917.53
8.2.90.0080.00017.78
8.2.80.0030.00517.97
8.2.70.0000.00817.91
8.2.60.0050.00318.08
8.2.50.0080.00018.10
8.2.40.0080.00019.33
8.2.30.0090.00019.23
8.2.20.0060.00317.99
8.2.10.0040.00418.79
8.2.00.0070.00019.28
8.1.300.0000.00816.12
8.1.290.0070.00318.88
8.1.280.0080.00825.92
8.1.270.0040.00420.57
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0090.00023.97
8.1.230.0100.00021.04
8.1.220.0000.00917.74
8.1.210.0030.00620.05
8.1.200.0060.00317.22
8.1.190.0030.00517.00
8.1.180.0000.00818.10
8.1.170.0000.00818.43
8.1.160.0040.00418.95
8.1.150.0000.00718.73
8.1.140.0050.00220.62
8.1.130.0030.00320.14
8.1.120.0040.00417.46
8.1.110.0040.00417.39
8.1.100.0000.00717.32
8.1.90.0000.00717.44
8.1.80.0080.00017.46
8.1.70.0070.00017.35
8.1.60.0030.00617.53
8.1.50.0080.00017.43
8.1.40.0030.00517.37
8.1.30.0050.00217.41
8.1.20.0040.00417.55
8.1.10.0020.00517.42
8.1.00.0080.00017.23
8.0.300.0000.00721.95
8.0.290.0000.00816.63
8.0.280.0070.00018.37
8.0.270.0000.00817.14
8.0.260.0000.00620.01
8.0.250.0000.00816.93
8.0.240.0030.00316.93
8.0.230.0080.00016.82
8.0.220.0030.00316.65
8.0.210.0040.00416.69
8.0.200.0000.00616.73
8.0.190.0000.00816.79
8.0.180.0080.00016.81
8.0.170.0080.00416.83
8.0.160.0000.00716.71
8.0.150.0000.00816.76
8.0.140.0040.00416.67
8.0.130.0000.00513.23
8.0.120.0030.00316.79
8.0.110.0000.00716.64
8.0.100.0030.00316.89
8.0.90.0060.00316.77
8.0.80.0110.00716.81
8.0.70.0030.00616.66
8.0.60.0030.00516.81
8.0.50.0000.00816.64
8.0.30.0090.00617.02
8.0.20.0040.01417.07
8.0.10.0000.00716.95
8.0.00.0130.00616.55
7.4.330.0040.00015.55
7.4.320.0000.00616.43
7.4.300.0000.00616.38
7.4.290.0040.00416.32
7.4.280.0030.00516.46
7.4.270.0070.00016.43
7.4.260.0000.00513.24
7.4.250.0030.00616.50
7.4.240.0020.00616.43
7.4.230.0000.00716.50
7.4.220.0020.00516.48
7.4.210.0050.01116.53
7.4.200.0030.00316.51
7.4.130.0100.00716.40
7.4.120.0160.01316.29
7.4.110.0090.01216.63
7.4.100.0200.00316.39
7.4.90.0130.01016.39
7.4.80.0070.01119.39
7.4.70.0070.01016.37
7.4.60.0060.01216.26
7.4.50.0100.01016.25
7.4.40.0100.01016.29
7.4.10.0110.00714.78
7.4.00.0070.01014.79
7.3.330.0040.00416.06
7.3.320.0000.00513.25
7.3.310.0000.00716.07
7.3.300.0030.00316.13
7.3.290.0100.00716.20
7.3.280.0030.01016.12
7.3.260.0100.00716.42
7.3.230.0060.01016.49
7.3.210.0100.00716.40
7.3.200.0030.01416.58
7.3.190.0220.00316.39
7.3.180.0060.00916.38
7.3.170.0100.01016.34
7.3.160.0060.00916.24
7.3.130.0050.01014.70
7.3.120.0020.01414.57
7.3.110.0080.01014.80
7.3.100.0060.01114.78
7.3.90.0100.00714.55
7.3.80.0110.00314.78
7.3.70.0050.01214.64
7.3.60.0060.00814.64
7.3.50.0130.00314.74
7.3.40.0040.01314.72
7.3.30.0050.01214.57
7.3.20.0100.00715.63
7.3.10.0090.00515.58
7.3.00.0040.00815.68
7.2.330.0100.01316.66
7.2.320.0080.00816.52
7.2.310.0130.00316.72
7.2.300.0190.00316.52
7.2.290.0120.00416.60
7.2.260.0060.01014.89
7.2.250.0100.00715.05
7.2.240.0080.00914.81
7.2.230.0100.00715.02
7.2.220.0100.00814.81
7.2.210.0080.00814.88
7.2.200.0080.01014.91
7.2.190.0020.01414.68
7.2.180.0130.00214.75
7.2.170.0050.00814.96
7.2.160.0110.00514.94
7.2.150.0020.01615.79
7.2.140.0020.01415.77
7.2.130.0030.00815.86
7.2.120.0070.00715.83
7.2.110.0090.00715.76
7.2.100.0080.00715.84
7.2.90.0110.00715.71
7.2.80.0050.00915.52
7.2.70.0090.00715.90
7.2.60.0100.00515.95
7.2.50.0090.00715.63
7.2.40.0130.00515.89
7.2.30.0100.00415.58
7.2.20.0100.00715.69
7.2.10.0070.00715.86
7.2.00.0080.00915.98
7.1.330.0070.01114.70
7.1.320.0060.01114.65
7.1.310.0070.00914.88
7.1.300.0050.00914.57
7.1.290.0070.00414.56
7.1.280.0090.00814.56
7.1.270.0100.00414.52
7.1.260.0070.00814.67
7.1.250.0060.00614.71
7.1.240.0000.01115.51
7.1.230.0070.00715.48
7.1.220.0030.00615.71
7.1.210.0060.00615.44
7.1.200.0060.00915.67
7.1.190.0030.01315.81
7.1.180.0000.01615.42
7.1.170.0060.00315.77
7.1.160.0060.00615.81
7.1.150.0000.01615.76
7.1.140.0040.01115.64
7.1.130.0070.00715.66
7.1.120.0070.00315.63
7.1.110.0030.00915.61
7.1.100.0000.01515.47
7.1.90.0040.00715.71
7.1.80.0100.00315.70
7.1.70.0110.00315.54
7.1.60.0120.00415.75
7.1.50.0070.00715.80
7.1.40.0040.01115.38
7.1.30.0040.00715.62
7.1.20.0030.01215.62
7.1.10.0080.00415.43
7.1.00.0030.01315.52

preferences:
26.39 ms | 403 KiB | 5 Q