3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface ILog { public function log(string $message, ... $args) : void; } class Foo { public function __construct(ILog $logger) { $this->logger = $logger; } public function thing() { $this->logger->log("thing"); } } $logger = function (string $message, ... $args) implements ILog : void { printf("{$message}\n", ... $args); }; $foo = new Foo($logger); $foo->thing(); $logger("next thing");

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)
7.0.60.0160.07019.99
7.0.50.0920.05720.33
7.0.40.1000.05720.26
7.0.30.0970.06120.28
7.0.20.0920.05320.28
7.0.10.0990.05620.28
7.0.00.0880.06420.32
5.6.210.0100.05420.65
5.6.200.0870.06321.08
5.6.190.0890.05821.09
5.6.180.0920.05421.08
5.6.170.0880.06021.16
5.6.160.0830.05921.05
5.6.150.0840.05621.02
5.6.140.0830.05321.13
5.6.130.0680.06621.09
5.6.120.0340.06721.07
5.6.110.0900.05921.14
5.6.100.0800.05821.02
5.6.90.0840.05721.06
5.6.80.0800.05120.50
5.6.70.0830.05420.43
5.6.60.0770.05420.46
5.6.50.0780.05820.41
5.6.40.0730.05620.45
5.6.30.0880.05320.44
5.6.20.0770.05220.44
5.6.10.0820.06020.47
5.6.00.0640.06220.42
5.5.350.1800.05120.42
5.5.340.0920.05620.85
5.5.330.0830.05620.93
5.5.320.0860.05320.84
5.5.310.0780.06020.83
5.5.300.0830.05720.91
5.5.290.0900.06620.90
5.5.280.0210.06320.93
5.5.270.0760.07020.83
5.5.260.0660.05820.81
5.5.250.0810.05620.63
5.5.240.0880.06120.20
5.5.230.0860.05720.16
5.5.220.0720.06320.19
5.5.210.0700.05820.20
5.5.200.0690.05820.26
5.5.190.0810.06120.20
5.5.180.0790.05720.24
5.5.160.0790.05020.31
5.5.150.0930.05620.15
5.5.140.0880.05420.20
5.5.130.0830.05120.22
5.5.120.0890.05120.21
5.5.110.0860.06020.22
5.5.100.0730.05720.16
5.5.90.0820.05420.12
5.5.80.0800.05820.02
5.5.70.0530.05820.10
5.5.60.0700.05220.12
5.5.50.0710.05220.07
5.5.40.0810.05320.09
5.5.30.0910.05820.22
5.5.20.0870.05220.03
5.5.10.0780.05420.03
5.5.00.0800.05320.03
5.4.450.1270.05719.42
5.4.440.0070.06219.42
5.4.430.1030.04719.50
5.4.420.1050.05819.29
5.4.410.1070.05219.17
5.4.400.1170.05019.15
5.4.390.1070.05319.07
5.4.380.1080.05019.10
5.4.370.0870.05719.22
5.4.360.1020.05019.07
5.4.350.1050.06019.09
5.4.340.1050.05219.17
5.4.320.0870.06519.19
5.4.310.1130.04519.15
5.4.300.1100.04818.96
5.4.290.1020.06319.07
5.4.280.1150.05819.04
5.4.270.1050.05219.08
5.4.260.1070.05519.08
5.4.250.1030.05319.24
5.4.240.1020.05719.02
5.4.230.0580.06319.13
5.4.220.1000.05519.02
5.4.210.1180.06019.07
5.4.200.1050.06719.03
5.4.190.1380.04019.01
5.4.180.1170.05319.06
5.4.170.1020.05719.06
5.4.160.1030.04819.05
5.4.150.0970.05219.02
5.4.140.1080.05816.54
5.4.130.1120.05316.42
5.4.120.1050.05216.46
5.4.110.0950.06016.32
5.4.100.1100.06016.52
5.4.90.1100.05016.48
5.4.80.1070.05216.54
5.4.70.1120.05216.42
5.4.60.1050.04816.43
5.4.50.1050.04816.42
5.4.40.1000.05016.50
5.4.30.0850.05516.53
5.4.20.1000.04816.41
5.4.10.0900.05716.47
5.4.00.0900.05515.83
5.3.290.1100.04714.68
5.3.280.0480.05814.55
5.3.270.1220.04814.70
5.3.260.1120.04514.63
5.3.250.1030.06014.58
5.3.240.1230.05014.69
5.3.230.1170.06014.63
5.3.220.0980.05314.61
5.3.210.1100.05814.60
5.3.200.1080.05314.55
5.3.190.1030.05314.60
5.3.180.1300.06014.61
5.3.170.1100.05714.57
5.3.160.0950.05514.63
5.3.150.0950.05514.57
5.3.140.0900.05014.56
5.3.130.1050.05514.63
5.3.120.0880.06214.55
5.3.110.1100.05514.51
5.3.100.1050.05714.08
5.3.90.1030.06214.02
5.3.80.1100.04814.06
5.3.70.1170.05014.05
5.3.60.1100.04513.99
5.3.50.1220.05314.01
5.3.40.1270.05313.98
5.3.30.1230.04513.88
5.3.20.1270.04513.70
5.3.10.1070.05013.61
5.3.00.1230.05013.60
5.2.170.0970.04211.05
5.2.160.0830.04011.13
5.2.150.1080.04011.19
5.2.140.0880.04711.13
5.2.130.0950.04011.19
5.2.120.0930.03311.14
5.2.110.0850.03811.16
5.2.100.1000.03811.10
5.2.90.0980.04311.08
5.2.80.0980.04211.04
5.2.70.0930.04011.18
5.2.60.0900.04311.07
5.2.50.0770.03711.04
5.2.40.0600.04011.06
5.2.30.0700.04310.94
5.2.20.0670.04010.91
5.2.10.0720.04210.90
5.2.00.0830.03810.76
5.1.60.0780.02510.07
5.1.50.0720.0329.98
5.1.40.0630.03310.07
5.1.30.0670.03310.31
5.1.20.0580.03810.32
5.1.10.0550.03710.07
5.1.00.0680.03510.12
5.0.50.0350.0258.53
5.0.40.0430.0278.44
5.0.30.0280.0588.21
5.0.20.0370.0328.28
5.0.10.0300.0288.11
5.0.00.0350.0438.18
4.4.90.0350.0257.01
4.4.80.0270.0237.03
4.4.70.0420.0207.04
4.4.60.0370.0237.06
4.4.50.0330.0237.06
4.4.40.0330.0327.08
4.4.30.0350.0207.11
4.4.20.0280.0257.13
4.4.10.0350.0227.14
4.4.00.0380.0327.16
4.3.110.0430.0207.19
4.3.100.0370.0237.19
4.3.90.0270.0307.21
4.3.80.0350.0327.23
4.3.70.0370.0227.24
4.3.60.0370.0237.24
4.3.50.0380.0257.24
4.3.40.0400.0327.25
4.3.30.0180.0227.25
4.3.20.0150.0187.25
4.3.10.0200.0277.26
4.3.00.0170.0237.27

preferences:
139.9 ms | 1394 KiB | 7 Q