3v4l.org

run code in 300+ PHP versions simultaneously
<?php class UserService { public function userFactory() { $user=new User(); $user->id='test_id'; return $user; } } class Conversation { public $participants=array(); public function getParticipants() { return $this->participants; } } class User { public $id; } $u1=new User(); $u2=new User(); $conversation=new Conversation(); $conversation->participants[]=$u1; $conversation->participants[]=$u2; $userService=new UserService(); foreach($conversation->getParticipants() as &$participant) { $participant=$userService->userFactory(); } print_r($conversation);

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.0180.00316.50
8.3.50.0040.01116.50
8.3.40.0140.00018.54
8.3.30.0140.00718.49
8.3.20.0070.00020.16
8.3.10.0030.00523.61
8.3.00.0080.00023.40
8.2.180.0210.00016.32
8.2.170.0100.00722.96
8.2.160.0150.00020.35
8.2.150.0080.00024.18
8.2.140.0000.01424.66
8.2.130.0040.00426.16
8.2.120.0030.01021.04
8.2.110.0060.00322.12
8.2.100.0040.00817.93
8.2.90.0050.00319.02
8.2.80.0060.00317.97
8.2.70.0030.00617.63
8.2.60.0040.00418.04
8.2.50.0080.00018.07
8.2.40.0000.00822.38
8.2.30.0080.00020.56
8.2.20.0050.00317.79
8.2.10.0050.00217.98
8.2.00.0040.00418.23
8.1.280.0140.00325.92
8.1.270.0160.00323.83
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.97
8.1.230.0040.00819.16
8.1.220.0050.00317.77
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0000.00817.35
8.1.180.0070.00318.10
8.1.170.0050.00318.59
8.1.160.0070.00020.82
8.1.150.0000.00718.89
8.1.140.0080.00019.58
8.1.130.0000.00717.58
8.1.120.0070.00017.54
8.1.110.0080.00017.29
8.1.100.0040.00417.44
8.1.90.0000.00717.36
8.1.80.0040.00417.44
8.1.70.0030.00317.50
8.1.60.0040.00417.57
8.1.50.0050.00317.46
8.1.40.0000.00817.53
8.1.30.0000.00917.70
8.1.20.0040.00417.53
8.1.10.0030.00617.59
8.1.00.0000.00817.52
8.0.300.0070.00018.77
8.0.290.0070.00016.63
8.0.280.0000.00818.29
8.0.270.0040.00417.21
8.0.260.0030.00317.16
8.0.250.0000.00816.95
8.0.240.0030.00316.95
8.0.230.0000.00616.91
8.0.220.0000.00816.79
8.0.210.0000.00716.77
8.0.200.0030.00316.84
8.0.190.0050.00316.93
8.0.180.0020.00516.91
8.0.170.0000.01016.95
8.0.160.0000.00816.86
8.0.150.0000.00716.80
8.0.140.0070.00016.79
8.0.130.0060.00013.38
8.0.120.0030.00516.86
8.0.110.0000.00716.78
8.0.100.0040.00416.93
8.0.90.0070.00016.96
8.0.80.0100.01016.85
8.0.70.0040.00416.72
8.0.60.0080.00016.74
8.0.50.0040.00416.94
8.0.30.0080.00817.07
8.0.20.0120.00817.42
8.0.10.0000.00717.04
8.0.00.0110.00916.81
7.4.330.0030.00316.84
7.4.320.0000.00616.55
7.4.300.0030.00316.42
7.4.290.0070.00016.45
7.4.280.0000.00916.46
7.4.270.0030.00316.50
7.4.260.0030.00316.44
7.4.250.0040.00416.56
7.4.240.0020.00516.57
7.4.230.0000.00716.67
7.4.220.0180.00616.56
7.4.210.0120.00316.46
7.4.200.0070.00016.36
7.4.160.0060.00916.55
7.4.150.0070.01017.40
7.4.140.0080.01717.86
7.4.130.0080.01216.49
7.4.120.0080.00816.61
7.4.110.0080.01116.52
7.4.100.0070.01116.39
7.4.90.0120.01216.59
7.4.80.0140.00419.39
7.4.70.0050.01016.51
7.4.60.0100.00716.59
7.4.50.0070.01016.56
7.4.40.0070.01416.36
7.4.30.0130.00316.62
7.4.10.0070.01114.63
7.4.00.0090.00614.92
7.3.330.0030.00313.29
7.3.320.0000.00513.32
7.3.310.0030.00316.20
7.3.300.0040.00416.14
7.3.290.0060.00916.30
7.3.280.0080.00816.30
7.3.270.0070.01017.40
7.3.260.0030.02016.50
7.3.250.0070.01016.42
7.3.240.0100.00816.53
7.3.230.0080.00816.43
7.3.210.0080.01116.45
7.3.200.0120.00616.38
7.3.190.0130.00616.50
7.3.180.0090.01216.61
7.3.170.0130.01016.43
7.3.160.0040.01116.45
7.3.130.0130.00614.68
7.3.120.0100.00714.61
7.3.110.0040.01414.88
7.3.100.0100.00614.80
7.3.90.0000.01514.72
7.3.80.0090.00415.05
7.3.70.0100.00714.55
7.3.60.0060.00914.88
7.3.50.0030.00915.06
7.3.40.0040.00814.90
7.3.30.0090.00614.62
7.3.20.0080.00616.36
7.3.10.0130.00616.65
7.3.00.0040.00716.80
7.2.330.0040.01516.78
7.2.320.0080.00816.88
7.2.310.0030.01316.48
7.2.300.0140.01016.66
7.2.290.0070.01016.68
7.2.260.0060.01315.19
7.2.250.0030.01415.16
7.2.240.0040.01115.00
7.2.230.0060.01214.76
7.2.220.0040.01515.10
7.2.210.0080.00315.16
7.2.200.0080.00415.12
7.2.190.0000.01315.03
7.2.180.0060.01314.81
7.2.170.0070.00715.04
7.2.160.0030.01215.02
7.2.150.0060.01216.95
7.2.140.0040.01116.71
7.2.130.0000.01117.12
7.2.120.0110.00717.12
7.2.110.0110.00717.05
7.2.100.0120.00316.96
7.2.90.0070.01016.79
7.2.80.0060.01017.07
7.2.70.0000.01317.06
7.2.60.0080.01116.80
7.2.50.0060.00317.00
7.2.40.0030.01016.87
7.2.30.0030.01217.13
7.2.20.0030.00816.70
7.2.10.0070.00717.00
7.2.00.0060.00918.00
7.1.330.0140.00015.86
7.1.320.0090.00915.90
7.1.310.0080.00615.86
7.1.300.0030.01015.90
7.1.290.0120.00015.98
7.1.280.0040.00415.67
7.1.270.0030.01615.69
7.1.260.0100.00315.75
7.1.250.0060.01115.68
7.1.240.0100.00615.98
7.1.230.0000.01715.59
7.1.220.0060.00615.71
7.1.210.0080.00415.74
7.1.200.0120.00315.78
7.1.190.0080.00415.56
7.1.180.0030.00916.05
7.1.170.0040.01115.46
7.1.160.0120.00315.92
7.1.150.0000.01415.66
7.1.140.0080.00315.91
7.1.130.0000.00815.77
7.1.120.0090.00615.54
7.1.110.0040.00815.51
7.1.100.0040.00717.01
7.1.90.0060.00315.62
7.1.80.0060.00315.77
7.1.70.0030.00916.33
7.1.60.0030.01617.64
7.1.50.0080.01116.45
7.1.40.0100.00315.65
7.1.30.0030.01015.49
7.1.20.0060.00615.74
7.1.10.0070.00315.95
7.1.00.0080.04018.95
7.0.330.0090.00615.60
7.0.320.0130.00015.53
7.0.310.0030.00715.49
7.0.300.0050.00515.46
7.0.290.0070.00715.61
7.0.280.0100.00315.34
7.0.270.0000.01315.59
7.0.260.0000.01215.45
7.0.250.0090.00315.46
7.0.240.0100.00315.17
7.0.230.0000.01615.54
7.0.220.0070.00315.51
7.0.210.0000.01715.52
7.0.200.0030.00915.97
7.0.190.0000.01415.31
7.0.180.0060.01115.48
7.0.170.0070.01015.47
7.0.160.0120.00615.34
7.0.150.0060.00315.52
7.0.140.0080.00815.40
7.0.130.0040.00915.54
7.0.120.0040.01215.63
7.0.110.0060.01015.43
7.0.100.0040.04417.66
7.0.90.0150.05017.62
7.0.80.0100.04317.65
7.0.70.0280.03317.93
7.0.60.0060.04617.78
7.0.50.0110.03618.03
7.0.40.0160.03616.84
7.0.30.0070.04516.85
7.0.20.0080.04516.82
7.0.10.0090.04416.81
7.0.00.0080.04216.72
5.6.400.0030.00914.43
5.6.390.0070.00714.30
5.6.380.0070.00714.50
5.6.370.0100.00314.35
5.6.360.0030.00914.32
5.6.350.0080.00514.43
5.6.340.0120.00314.53
5.6.330.0060.00914.61
5.6.320.0030.00714.50
5.6.310.0100.00314.52
5.6.300.0110.00314.55
5.6.290.0040.01114.50
5.6.280.0050.01917.81
5.6.270.0100.00714.61
5.6.260.0060.00614.54
5.6.250.0100.04117.46
5.6.240.0070.03317.58
5.6.230.0120.03717.54
5.6.220.0070.03217.46
5.6.210.0030.03317.60
5.6.200.0050.04917.75
5.6.190.0080.04217.88
5.6.180.0120.03917.79
5.6.170.0070.04417.79
5.6.160.0040.04717.87
5.6.150.0070.04217.88
5.6.140.0120.04217.76
5.6.130.0070.04217.65
5.6.120.0020.03717.80
5.6.110.0120.04317.65
5.6.100.0110.04617.74
5.6.90.0020.03917.61
5.6.80.0060.04417.41
5.6.70.0080.03217.39
5.6.60.0080.03817.33
5.6.50.0050.04617.41
5.6.40.0140.04017.48
5.6.30.0130.03217.45
5.6.20.0020.04017.31
5.6.10.0090.04317.49
5.6.00.0090.04217.32
5.5.380.0090.04317.40
5.5.370.0080.03317.18
5.5.360.0040.05117.31
5.5.350.0100.04317.28
5.5.340.0070.04217.63
5.5.330.0080.04117.78
5.5.320.0050.04017.71
5.5.310.0030.03717.61
5.5.300.0030.04317.67
5.5.290.0110.04317.45
5.5.280.0130.03817.67
5.5.270.0070.04417.68
5.5.260.0050.04317.70
5.5.250.0070.03817.63
5.5.240.0070.04317.30
5.5.230.0050.04017.36
5.5.220.0020.05217.11
5.5.210.0100.04217.39
5.5.200.0070.03917.20
5.5.190.0080.04017.28
5.5.180.0050.04317.28
5.5.170.0100.00314.41
5.5.160.0050.04617.20
5.5.150.0070.03817.18
5.5.140.0120.03717.10
5.5.130.0080.04317.24
5.5.120.0050.04617.29
5.5.110.0100.04017.17
5.5.100.0030.04517.29
5.5.90.0080.04117.19
5.5.80.0030.04717.22
5.5.70.0100.04017.12
5.5.60.0030.04317.01
5.5.50.0110.03817.18
5.5.40.0100.03317.08
5.5.30.0100.04517.19
5.5.20.0060.03916.95
5.5.10.0110.04317.11
5.5.00.0120.04216.91

preferences:
41.97 ms | 401 KiB | 5 Q