3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Delegator { private $delegates = []; protected function delegate($object, array $methods) { // check against duplicate methods $this->delegates[] = ['object' => $object, 'methods' => $methods]; } function __call($method, array $args) { foreach ($this->delegates as $delegate) { if (in_array($method, $delegate['methods'])) { return call_user_func_array([$delegate['object'], $method], $args); } } throw new Exception('Method not found!'); } } class AuthService { function authenticate($username, $password) { echo 'Doing the auth for ' . $username . '!'; } } class UserModel { use Delegator; function __construct(AuthService $auth) { $this->delegate($auth, ['authenticate']); } } $auth = new AuthService(); $model = new UserModel($auth); $model->authenticate('test', 'password');

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.58
8.3.30.0070.00719.04
8.3.20.0050.00320.33
8.3.10.0030.00623.70
8.3.00.0040.00417.50
8.2.170.0070.01122.96
8.2.160.0090.00920.39
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0070.01026.16
8.2.120.0040.00421.10
8.2.110.0060.00322.20
8.2.100.0120.00417.78
8.2.90.0050.00319.12
8.2.80.0090.00017.97
8.2.70.0050.00317.50
8.2.60.0000.01018.05
8.2.50.0040.00418.07
8.2.40.0040.00418.09
8.2.30.0040.00418.18
8.2.20.0070.00017.63
8.2.10.0080.00018.12
8.2.00.0040.00417.65
8.1.270.0060.00323.84
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.68
8.1.230.0110.00019.00
8.1.220.0030.00617.74
8.1.210.0000.00818.77
8.1.200.0090.00017.23
8.1.190.0040.00417.25
8.1.180.0040.00418.10
8.1.170.0050.00318.30
8.1.160.0000.00722.04
8.1.150.0040.00418.81
8.1.140.0000.00717.45
8.1.130.0070.00017.70
8.1.120.0040.00417.41
8.1.110.0040.00417.50
8.1.100.0000.00817.46
8.1.90.0070.00017.37
8.1.80.0040.00417.36
8.1.70.0000.00717.38
8.1.60.0000.00817.60
8.1.50.0060.00317.44
8.1.40.0000.00817.55
8.1.30.0000.00817.52
8.1.20.0040.00417.63
8.1.10.0040.00417.57
8.1.00.0030.00517.49
8.0.300.0000.00818.77
8.0.290.0000.00816.63
8.0.280.0030.00318.46
8.0.270.0020.00517.19
8.0.260.0000.00617.26
8.0.250.0000.00717.04
8.0.240.0040.00416.96
8.0.230.0000.00717.04
8.0.220.0000.00816.83
8.0.210.0030.00316.90
8.0.200.0000.00817.01
8.0.190.0030.00517.02
8.0.180.0040.00417.01
8.0.170.0040.00416.88
8.0.160.0070.00016.90
8.0.150.0000.00716.92
8.0.140.0080.00016.97
8.0.130.0000.00613.41
8.0.120.0040.00416.80
8.0.110.0000.00716.97
8.0.100.0000.00716.82
8.0.90.0040.00416.92
8.0.80.0040.01116.95
8.0.70.0060.00316.77
8.0.60.0030.00716.91
8.0.50.0070.00016.82
8.0.30.0130.00617.15
8.0.20.0090.01317.40
8.0.10.0040.00416.93
8.0.00.0120.00516.69
7.4.330.0000.00615.00
7.4.320.0030.00316.66
7.4.300.0000.00616.61
7.4.290.0040.00416.53
7.4.280.0040.00416.53
7.4.270.0000.00716.36
7.4.260.0050.00316.59
7.4.250.0040.00416.37
7.4.240.0050.00216.52
7.4.230.0070.00016.39
7.4.220.0100.00716.56
7.4.210.0070.00716.48
7.4.200.0050.00316.46
7.4.160.0030.01316.51
7.4.150.0150.00917.40
7.4.140.0110.00717.86
7.4.130.0070.00916.58
7.4.120.0130.01016.56
7.4.110.0100.00716.54
7.4.100.0150.00616.46
7.4.90.0060.01216.63
7.4.80.0160.01019.39
7.4.70.0150.00316.70
7.4.60.0180.00616.51
7.4.50.0040.00416.43
7.4.40.0070.01016.48
7.4.30.0030.01416.33
7.4.00.0080.00815.00
7.3.330.0050.00013.22
7.3.320.0040.00313.38
7.3.310.0040.00416.25
7.3.300.0030.00316.25
7.3.290.0000.01416.36
7.3.280.0100.00716.41
7.3.270.0080.00817.40
7.3.260.0100.00716.44
7.3.250.0090.00916.51
7.3.240.0060.01016.37
7.3.230.0110.01416.39
7.3.210.0060.01316.42
7.3.200.0100.00719.39
7.3.190.0110.00716.29
7.3.180.0030.01616.64
7.3.170.0130.00316.52
7.3.160.0100.01016.36
7.3.120.0060.00915.12
7.3.110.0060.00914.54
7.3.100.0150.00014.94
7.3.90.0070.01014.96
7.3.80.0030.01314.79
7.3.70.0070.00714.95
7.3.60.0070.00314.85
7.3.50.0050.00514.65
7.3.40.0070.00714.83
7.3.30.0030.00914.62
7.3.20.0060.00616.55
7.3.10.0080.00716.71
7.3.00.0020.01016.76
7.2.330.0090.01016.79
7.2.320.0040.01816.79
7.2.310.0040.01216.57
7.2.300.0060.00916.36
7.2.290.0110.01116.44
7.2.240.0050.00515.08
7.2.230.0040.01115.04
7.2.220.0060.01114.88
7.2.210.0040.00815.13
7.2.200.0070.01015.19
7.2.190.0060.01015.10
7.2.180.0040.01115.04
7.2.170.0000.01015.24
7.2.160.0090.00614.93
7.2.150.0060.01016.73
7.2.140.0090.00616.73
7.2.130.0040.00916.88
7.2.120.0070.00616.99
7.2.110.0070.00616.83
7.2.100.0070.00717.06
7.2.90.0070.00717.05
7.2.80.0050.00816.91
7.2.70.0050.00917.11
7.2.60.0030.01016.71
7.2.50.0080.00516.85
7.2.40.0060.00717.10
7.2.30.0020.01316.99
7.2.20.0080.00517.03
7.2.10.0080.00616.97
7.2.00.0050.00817.88
7.1.330.0000.01215.75
7.1.320.0100.00015.85
7.1.310.0070.00715.73
7.1.300.0060.01215.57
7.1.290.0060.01215.89
7.1.280.0070.01015.75
7.1.270.0060.00915.76
7.1.260.0040.01115.62
7.1.250.0030.00915.84
7.1.200.0000.01415.95
7.1.100.0000.01317.87
7.1.70.0080.00317.26
7.1.60.0100.01419.40
7.1.50.0130.00616.64
7.1.00.0000.07722.28
7.0.200.0040.00416.63
7.0.140.0030.07721.98
7.0.60.0070.08719.89
7.0.50.0070.04717.83
7.0.40.0030.04320.40
7.0.30.0270.05720.02
7.0.20.0270.08320.30
7.0.10.0130.03320.25
7.0.00.0070.05320.16
5.6.280.0070.07021.13
5.6.210.0070.09320.74
5.6.200.0000.07018.14
5.6.190.0000.04720.52
5.6.180.0300.04720.50
5.6.170.0330.06020.52
5.6.160.0070.08320.46
5.6.150.0070.04318.19
5.6.140.0000.06718.14
5.6.130.0070.08018.18
5.6.120.0070.09021.11
5.6.110.0230.06321.12
5.6.100.0000.05020.98
5.6.90.0030.04321.11
5.6.80.0170.07720.51
5.5.350.3670.04020.34
5.5.340.0070.04718.04
5.5.330.0100.08020.43
5.5.320.0230.08320.33
5.5.310.0400.04320.34
5.5.300.0100.07317.98
5.5.290.0030.06017.94
5.5.280.0070.08020.90
5.5.270.0030.04320.65
5.5.260.0070.04020.80
5.5.250.0070.04720.59
5.5.240.0070.07320.30
5.4.450.0230.07719.39
5.4.440.0270.05019.30
5.4.430.0400.05719.20
5.4.420.0200.05019.47
5.4.410.0230.06719.32
5.4.400.0330.03319.25
5.4.390.0270.06718.98
5.4.380.0300.07319.00
5.4.370.0270.06718.87
5.4.360.0170.04719.09
5.4.350.0170.04018.95
5.4.340.0230.06719.17
5.4.320.0270.03719.05
5.4.310.0330.02718.88
5.4.300.0330.07319.22
5.4.290.0200.04319.06
5.4.280.0230.03719.09
5.4.270.0230.03718.99
5.4.260.0330.04319.22
5.4.250.0200.04018.86
5.4.240.0330.06719.08
5.4.230.0230.04319.30
5.4.220.0200.04018.83
5.4.210.0330.04019.15
5.4.200.0200.04018.99
5.4.190.0200.05019.05
5.4.180.0270.03318.86
5.4.170.0200.04319.25
5.4.160.0230.04718.82
5.4.150.0200.04019.20
5.4.140.0200.03716.41
5.4.130.0200.03716.33
5.4.120.0230.05316.50
5.4.110.0200.03716.33
5.4.100.0300.02716.61
5.4.90.0230.03316.60
5.4.80.0200.03716.58
5.4.70.0230.03316.48
5.4.60.0200.05016.39
5.4.50.0200.03716.48
5.4.40.0200.05316.38
5.4.30.0200.03716.23
5.4.20.0300.04316.43
5.4.10.0300.07316.26
5.4.00.0300.05016.11
5.3.290.0200.04014.54
5.3.280.0300.03014.69
5.3.270.0200.04014.54
5.3.260.0270.08014.62
5.3.250.0270.03314.53
5.3.240.0200.04714.70
5.3.230.0130.04314.65
5.3.220.0270.03314.40
5.3.210.0300.05014.42
5.3.200.0130.04314.66
5.3.190.0130.04014.41
5.3.180.0230.07314.43
5.3.170.0300.04014.44
5.3.160.0300.06714.42
5.3.150.0200.03714.54
5.3.140.0270.03314.40
5.3.130.0200.03714.39
5.3.120.0270.03714.64
5.3.110.0270.03314.38
5.3.100.0200.04313.91
5.3.90.0200.04714.11
5.3.80.0270.07313.84
5.3.70.0200.06014.06
5.3.60.0200.04313.77
5.3.50.0300.06313.96
5.3.40.0230.04013.79
5.3.30.0300.05314.01
5.3.20.0230.03713.65
5.3.10.0230.04713.70
5.3.00.0270.04713.65
5.2.170.0230.06010.99
5.2.160.0230.06011.09
5.2.150.0170.05011.00
5.2.140.0200.03011.08
5.2.130.0200.06310.96
5.2.120.0170.04011.18
5.2.110.0270.05711.26
5.2.100.0270.05710.99
5.2.90.0200.04010.98
5.2.80.0270.03010.95
5.2.70.0330.05011.14
5.2.60.0300.04310.88
5.2.50.0230.05010.88
5.2.40.0100.03710.83
5.2.30.0170.03710.80
5.2.20.0230.05310.81
5.2.10.0100.03710.82
5.2.00.0130.04010.69
5.1.60.0230.0479.97
5.1.50.0170.0409.88
5.1.40.0170.0339.86
5.1.30.0100.03310.25
5.1.20.0200.05010.42
5.1.10.0170.02710.08
5.1.00.0170.04310.24
5.0.50.0100.0408.71
5.0.40.0130.0408.28
5.0.30.0070.0308.20
5.0.20.0070.0238.32
5.0.10.0070.0208.25
5.0.00.0130.0478.13
4.4.90.0070.0407.32
4.4.80.0070.0237.32
4.4.70.0170.0307.32
4.4.60.0100.0277.32
4.4.50.0100.0377.32
4.4.40.0100.0407.32
4.4.30.0100.0277.32
4.4.20.0130.0237.32
4.4.10.0200.0277.32
4.4.00.0130.0407.32
4.3.110.0070.0407.32
4.3.100.0100.0237.32
4.3.90.0130.0177.32
4.3.80.0070.0337.32
4.3.70.0170.0277.32
4.3.60.0070.0177.32
4.3.50.0100.0307.32
4.3.40.0100.0477.32
4.3.30.0030.0277.32
4.3.20.0030.0307.32
4.3.10.0030.0337.32
4.3.00.0000.0207.32

preferences:
35.93 ms | 400 KiB | 5 Q