3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); const PI_NAME = 'Число Пи'; const E_NAME = 'Число Эйлера'; final class Interpolator { public function __construct( private string $format = '%s' ) { } public function __invoke(mixed $value): string { return sprintf($this->format, $value); } } $sprintfString = sprintf( <<<'JSON' [ { "value": "%s", "name": "%s" }, { "value": "%s", "name": "%s" } ] JSON, pi(), PI_NAME, M_E, E_NAME, ); $intrp = new Interpolator(); $intrpString = <<<JSON [ { "value": "{$intrp(pi())}", "name": "{$intrp(PI_NAME)}" }, { "value": "{$intrp(M_E)}", "name": "{$intrp(E_NAME)}" } ] JSON; var_dump(assert($sprintfString === $intrpString));

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.4.120.0110.01023.94
8.4.110.0060.00418.69
8.4.100.0140.00819.09
8.4.90.0060.00322.41
8.4.80.0110.00918.94
8.4.70.0080.01218.21
8.4.60.0120.00818.82
8.4.50.0080.01122.47
8.4.40.0150.00619.34
8.4.30.0170.00320.37
8.4.20.0130.00618.98
8.4.10.0060.00319.41
8.3.250.0110.00818.79
8.3.240.0130.00617.24
8.3.230.0060.00316.95
8.3.220.0130.00718.80
8.3.210.0050.00418.29
8.3.200.0040.00516.93
8.3.190.0080.00717.10
8.3.180.0100.00816.92
8.3.170.0130.00616.97
8.3.160.0040.00418.48
8.3.150.0110.00716.49
8.3.140.0140.00417.29
8.3.130.0130.00718.46
8.3.120.0060.00319.00
8.3.110.0050.00520.94
8.3.100.0000.00816.53
8.3.90.0060.00326.77
8.3.80.0060.00318.56
8.3.70.0150.00616.63
8.3.60.0160.00718.31
8.3.50.0110.00718.11
8.3.40.0030.01218.67
8.3.30.0110.00418.84
8.3.20.0040.00424.18
8.3.10.0050.00324.66
8.3.00.0030.00626.16
8.2.290.0040.00522.14
8.2.280.0110.00818.55
8.2.270.0060.01216.97
8.2.260.0060.00916.81
8.2.250.0080.00018.24
8.2.240.0070.01016.93
8.2.230.0030.00622.58
8.2.220.0120.00324.06
8.2.210.0040.01126.77
8.2.200.0000.01016.75
8.2.190.0070.01018.42
8.2.180.0130.01025.92
8.2.170.0180.00318.93
8.2.160.0120.00322.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0090.00019.83
8.2.110.0030.00620.99
8.2.100.0040.00717.73
8.2.90.0000.00818.22
8.2.80.0060.00318.16
8.2.70.0040.00417.88
8.2.60.0000.00918.22
8.2.50.0040.00418.10
8.2.40.0030.00521.25
8.2.30.0000.00719.26
8.2.20.0050.00218.13
8.2.10.0050.00219.16
8.2.00.0040.00419.16
8.1.330.0100.00921.85
8.1.320.0100.00916.09
8.1.310.0050.00318.66
8.1.300.0140.00319.83
8.1.290.0030.00630.84
8.1.280.0000.01825.92
8.1.270.0000.00823.90
8.1.260.0060.00326.35
8.1.250.0050.00328.09
8.1.240.0000.00824.02
8.1.230.0000.01020.96
8.1.220.0000.00817.78
8.1.210.0000.00818.77
8.1.200.0000.00817.35
8.1.190.0000.00917.21
8.1.180.0060.00318.10
8.1.170.0030.00518.65
8.1.160.0080.00020.67
8.1.150.0000.00818.87
8.1.140.0050.00617.92
8.1.130.0040.00417.37
8.1.120.0040.00417.38
8.1.110.0060.00317.43
8.1.100.0060.00717.39
8.1.90.0110.00317.39
8.1.80.0100.00317.45
8.1.70.0070.00717.42
8.1.60.0110.00517.56
8.1.50.0100.00517.49
8.1.40.0100.00617.47
8.1.30.0090.00817.60
8.1.20.0100.00617.65
8.1.10.0090.00517.51
8.1.00.0110.00417.46
8.0.300.0040.00419.72
8.0.290.0070.00016.75
8.0.280.0040.00418.34
8.0.270.0070.00016.89
8.0.260.0000.00816.94
8.0.250.0000.00917.05
8.0.240.0130.00216.98
8.0.230.0090.00416.96
8.0.220.0060.00716.93
8.0.210.0100.00316.95
8.0.200.0100.00516.96
8.0.190.0080.00617.02
8.0.180.0080.00616.94
8.0.170.0080.00516.94
8.0.160.0090.00516.94
8.0.150.0100.00316.90
8.0.140.0080.00516.84
8.0.130.0070.00716.36
8.0.120.0090.00516.89
8.0.110.0080.00616.89
8.0.100.0090.00516.88
8.0.90.0100.00416.92
8.0.80.0090.00616.91
8.0.70.0140.00516.88
8.0.60.0130.00616.88
8.0.50.0120.00616.85
8.0.30.0180.00916.87
8.0.20.0180.00816.95
8.0.10.0190.00717.00
8.0.00.0160.00817.04
7.4.330.0000.00415.55
7.4.320.0030.00416.44
7.4.300.0100.00516.39
7.4.290.0070.00816.41
7.4.280.0120.00316.37
7.4.270.0070.00616.37
7.4.260.0070.00515.94
7.4.250.0120.00416.36
7.4.240.0090.00516.36
7.4.230.0120.00416.37
7.4.220.0080.00416.38
7.4.210.0110.00516.41
7.4.200.0120.00716.39
7.4.190.0120.00516.45
7.4.180.0090.00616.43
7.4.160.0160.00816.37
7.4.150.0170.00716.32
7.4.140.0170.00816.26
7.4.130.0170.00716.17
7.4.120.0150.00916.18
7.4.110.0170.00916.20
7.4.100.0170.00816.31
7.4.90.0150.00916.20
7.4.80.0180.00716.19
7.4.70.0160.00816.15
7.4.60.0160.00916.19
7.4.50.0160.00816.10
7.4.40.0180.00816.10
7.4.30.0160.00816.16
7.4.20.0150.00916.17
7.4.10.0170.00616.18
7.4.00.0160.00716.21
7.3.330.0100.00916.05
7.3.320.0130.00415.75
7.3.310.0110.00416.11
7.3.300.0120.00416.10
7.3.290.0150.00316.11
7.3.280.0170.00816.10
7.3.270.0190.00616.12
7.3.260.0170.00816.10
7.3.250.0170.00716.12
7.3.240.0170.00716.09
7.3.230.0180.00816.13
7.3.220.0170.00816.06
7.3.210.0170.00716.06
7.3.200.0170.00816.02
7.3.190.0150.00916.03
7.3.180.0160.00916.05
7.3.170.0200.00816.01
7.3.160.0190.00716.06
7.3.150.0170.00916.03
7.3.140.0180.00716.06
7.3.130.0160.00916.06
7.3.120.0160.00816.02
7.3.110.0180.00716.00
7.3.100.0180.00715.98
7.3.90.0190.00816.31
7.3.80.0180.00816.04
7.3.70.0180.00816.12
7.3.60.0170.00816.16
7.3.50.0180.00816.15
7.3.40.0180.00716.12
7.3.30.0170.00716.17
7.3.20.0180.00716.27
7.3.10.0160.00916.23
7.3.00.0210.00716.21

preferences:
28.5 ms | 403 KiB | 5 Q