3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Delegator { private $delegates = []; protected function delegate($object, array $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.60.0060.00916.47
8.3.50.0140.00522.98
8.3.40.0070.01119.04
8.3.30.0140.00319.22
8.3.20.0070.00020.09
8.3.10.0050.00323.66
8.3.00.0050.00319.51
8.2.180.0070.01118.30
8.2.170.0070.00722.96
8.2.160.0040.01120.32
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0150.00326.16
8.2.120.0040.00421.02
8.2.110.0060.00322.00
8.2.100.0040.00817.78
8.2.90.0040.00419.21
8.2.80.0030.00617.97
8.2.70.0000.00817.50
8.2.60.0000.01217.93
8.2.50.0080.00018.07
8.2.40.0000.00818.22
8.2.30.0070.00018.04
8.2.20.0080.00017.80
8.2.10.0000.00818.18
8.2.00.0040.00417.63
8.1.280.0040.01125.92
8.1.270.0050.00324.05
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.61
8.1.230.0060.00622.75
8.1.220.0030.00517.78
8.1.210.0000.00918.77
8.1.200.0070.00417.35
8.1.190.0080.00017.35
8.1.180.0050.00318.10
8.1.170.0080.00018.55
8.1.160.0000.00721.95
8.1.150.0030.00618.80
8.1.140.0040.00417.33
8.1.130.0000.00717.45
8.1.120.0070.00017.50
8.1.110.0000.00817.47
8.1.100.0000.00717.38
8.1.90.0030.00317.52
8.1.80.0000.00717.36
8.1.70.0070.00017.33
8.1.60.0040.00417.60
8.1.50.0040.00417.52
8.1.40.0030.00617.55
8.1.30.0000.00817.63
8.1.20.0030.00717.65
8.1.10.0000.00817.53
8.1.00.0000.00817.44
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0040.00418.45
8.0.270.0000.00717.16
8.0.260.0040.00416.84
8.0.250.0030.00317.00
8.0.240.0000.00816.89
8.0.230.0000.00717.01
8.0.220.0000.00717.00
8.0.210.0000.00716.94
8.0.200.0000.00716.92
8.0.190.0050.00317.01
8.0.180.0040.00417.04
8.0.170.0040.00416.99
8.0.160.0040.00416.92
8.0.150.0040.00416.95
8.0.140.0040.00416.82
8.0.130.0060.00013.36
8.0.120.0000.00816.91
8.0.110.0040.00416.78
8.0.100.0040.00416.83
8.0.90.0070.00016.95
8.0.80.0110.00417.05
8.0.70.0060.00316.80
8.0.60.0040.00416.95
8.0.50.0050.00316.82
8.0.30.0100.01317.18
8.0.20.0090.01017.40
8.0.10.0050.00316.92
8.0.00.0080.01116.85
7.4.330.0060.00015.00
7.4.320.0000.00616.61
7.4.300.0060.00016.51
7.4.290.0000.00716.50
7.4.280.0030.00516.54
7.4.270.0070.00016.43
7.4.260.0050.00216.55
7.4.250.0040.00416.59
7.4.240.0000.00716.48
7.4.230.0030.00316.62
7.4.220.0090.00916.56
7.4.210.0130.00716.51
7.4.200.0040.00416.55
7.4.160.0070.01016.48
7.4.150.0130.00917.40
7.4.140.0060.01217.86
7.4.130.0110.00716.56
7.4.120.0110.00716.54
7.4.110.0090.00916.41
7.4.100.0120.00916.44
7.4.90.0090.00916.64
7.4.80.0070.01819.39
7.4.70.0100.00716.52
7.4.60.0090.01516.52
7.4.50.0000.00916.44
7.4.40.0100.01016.52
7.4.30.0140.00316.61
7.4.00.0070.00715.11
7.3.330.0000.00513.20
7.3.320.0040.00413.34
7.3.310.0000.00716.39
7.3.300.0030.00316.15
7.3.290.0100.00316.36
7.3.280.0080.00916.33
7.3.270.0070.01017.40
7.3.260.0100.00716.39
7.3.250.0110.00816.53
7.3.240.0090.00816.38
7.3.230.0180.00716.57
7.3.210.0090.00916.56
7.3.200.0100.01019.39
7.3.190.0040.01416.39
7.3.180.0090.00616.32
7.3.170.0070.01016.45
7.3.160.0150.00316.60
7.3.10.0070.00716.75
7.3.00.0070.00316.64
7.2.330.0160.00316.82
7.2.320.0060.01516.74
7.2.310.0080.00816.48
7.2.300.0100.00716.71
7.2.290.0050.01116.42
7.2.130.0030.01016.61
7.2.120.0090.00617.03
7.2.110.0070.00717.06
7.2.100.0100.00017.11
7.2.90.0060.00917.02
7.2.80.0030.01317.11
7.2.70.0000.01416.95
7.2.60.0020.01116.92
7.2.50.0110.00416.98
7.2.40.0070.01016.96
7.2.30.0120.00316.86
7.2.20.0030.00616.92
7.2.10.0070.00716.91
7.2.00.0030.01018.23
7.1.250.0030.00615.59
7.1.200.0030.00915.71
7.1.100.0040.00717.98
7.1.70.0070.00317.19
7.1.60.0060.01619.40
7.1.50.0100.01316.89
7.1.00.0030.07722.29
7.0.200.0000.00916.43
7.0.140.0030.07722.09
7.0.60.0130.08019.86
7.0.50.0070.08017.87
7.0.40.0130.08020.13
7.0.30.0270.07020.09
7.0.20.0230.06020.12
7.0.10.0200.06020.21
7.0.00.0100.07720.20
5.6.280.0000.07721.04
5.6.210.0030.04020.55
5.6.200.0070.04018.19
5.6.190.0070.07020.47
5.6.180.0300.07720.62
5.6.170.0170.04320.69
5.6.160.0070.04720.55
5.6.150.0030.05018.27
5.6.140.0100.08018.19
5.6.130.0130.07718.17
5.6.120.0100.06721.13
5.6.110.0130.08021.02
5.6.100.0130.06321.02
5.6.90.0030.09021.04
5.6.80.0170.07020.41
5.5.350.0430.06720.42
5.5.340.0030.07717.95
5.5.330.0130.06020.40
5.5.320.3430.03720.56
5.5.310.0530.03020.32
5.5.300.0100.07317.98
5.5.290.0100.07718.08
5.5.280.0230.05320.98
5.5.270.0100.07020.90
5.5.260.0030.04020.77
5.5.250.0000.04320.67
5.5.240.0030.06320.20
5.4.450.3130.04019.41
5.4.440.2900.04319.50
5.4.430.3300.03019.57
5.4.420.3070.04019.30
5.4.410.3270.03319.39
5.4.400.3200.04019.15
5.4.390.3330.03719.13
5.4.380.3170.04019.17
5.4.370.3100.03318.95
5.4.360.3000.03718.88
5.4.350.3030.03719.22
5.4.340.3270.03018.95
5.4.320.3930.03319.09
5.4.310.3900.03719.15
5.4.300.3030.04318.95
5.4.290.3170.03719.09
5.4.280.2630.03719.17
5.4.270.3170.04019.09
5.4.260.2970.03319.21
5.4.250.3170.04019.19
5.4.240.3170.04019.16
5.4.230.2930.03718.94
5.4.220.3170.04019.01
5.4.210.3200.03319.05
5.4.200.3200.03719.06
5.4.190.2900.04019.07
5.4.180.3100.03718.88
5.4.170.3230.03718.97
5.4.160.3170.04019.14
5.4.150.3200.03719.06
5.4.140.3170.04016.54
5.4.130.2970.03016.56
5.4.120.3230.03316.72
5.4.110.3170.03716.27
5.4.100.2730.03716.25
5.4.90.3030.03316.42
5.4.80.2970.03716.59
5.4.70.2970.03316.23
5.4.60.2930.03716.49
5.4.50.3030.03016.38
5.4.40.3500.04716.43
5.4.30.3000.03716.50
5.4.20.3670.03716.42
5.4.10.3000.03316.51
5.4.00.3030.03015.80
5.3.290.2970.04014.61
5.3.280.3100.04014.44
5.3.270.3070.03314.46
5.3.260.3270.04714.51
5.3.250.3300.04014.63
5.3.240.2930.04014.52
5.3.230.2830.04014.54
5.3.220.3100.03714.66
5.3.210.3330.03014.41
5.3.200.3070.03714.47
5.3.190.3230.03314.55
5.3.180.3400.04314.58
5.3.170.3330.02714.50
5.3.160.2830.03714.40
5.3.150.3030.03314.50
5.3.140.2930.04014.39
5.3.130.3430.04714.50
5.3.120.3200.03314.38
5.3.110.3030.03314.52
5.3.100.3330.04313.88
5.3.90.3430.04313.90
5.3.80.3170.03313.86
5.3.70.3470.04013.89
5.3.60.3230.03314.06
5.3.50.3230.03313.72
5.3.40.3170.04013.91
5.3.30.2900.04013.79
5.3.20.3230.03313.78
5.3.10.3400.04313.51
5.3.00.3470.03713.68
5.2.170.2730.03312.29
5.2.160.2700.02712.29
5.2.150.2500.02712.29
5.2.140.2500.02312.29
5.2.130.2630.02712.29
5.2.120.2670.03712.29
5.2.110.2530.02312.29
5.2.100.2830.03012.29
5.2.90.2870.03312.29
5.2.80.2700.02712.29
5.2.70.2900.02312.29
5.2.60.2770.03012.29
5.2.50.2770.03012.29
5.2.40.2200.03012.29
5.2.30.2170.03012.29
5.2.20.2200.02312.29
5.2.10.1930.03012.29
5.2.00.2130.03012.29
5.1.60.2230.02312.29
5.1.50.1970.02312.29
5.1.40.1930.02712.29
5.1.30.1970.02312.29
5.1.20.2300.02012.29
5.1.10.2030.02312.29
5.1.00.2230.02712.29
5.0.50.1230.02712.29
5.0.40.1170.02012.29
5.0.30.1230.04012.29
5.0.20.1030.02012.29
5.0.10.0970.02012.29
5.0.00.1200.03712.29
4.4.90.1200.02012.29
4.4.80.1200.01712.29
4.4.70.1170.02012.29
4.4.60.1200.02312.29
4.4.50.1030.01712.29
4.4.40.0970.02312.29
4.4.30.1130.02012.29
4.4.20.1170.02312.29
4.4.10.1000.01312.29
4.4.00.1270.03012.29
4.3.110.1170.01712.29
4.3.100.1270.01712.29
4.3.90.1200.01712.29
4.3.80.1300.02312.29
4.3.70.1000.01712.29
4.3.60.1100.02012.29
4.3.50.1230.01312.29
4.3.40.1000.02312.29
4.3.30.0600.01312.29
4.3.20.0630.02712.29
4.3.10.0630.02712.29
4.3.00.0670.01312.29

preferences:
42.46 ms | 401 KiB | 5 Q