3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class User extends Model { } class Model { public static function get() { // $records grabbed from db as associative array // key is id, value is StdClass instance $records = array( (object)array('name' => 'vic'), (object)array('name' => 'bob'), ); $ret = array(); foreach($records as $id=>$record) { print $record->name; // <--- FIRST PRINT LINE print $class; $new = new $class; $new->name = $record->name; $ret[] = $new; } return $ret; } } print "\n"; $users = User::get(); foreach($users as $id=>$user) { print $user->name; // <--- SECOND PRINT LINE }

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.70.0040.01118.43
8.3.60.0090.00618.43
8.3.50.0100.00722.06
8.3.40.0120.00318.63
8.3.30.0070.00719.02
8.3.20.0040.00420.16
8.3.10.0040.00422.02
8.3.00.0040.00422.43
8.2.180.0110.00716.88
8.2.170.0090.00622.96
8.2.160.0070.00720.89
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00419.61
8.2.110.0030.00722.30
8.2.100.0050.00517.84
8.2.90.0000.00819.30
8.2.80.0060.00318.05
8.2.70.0000.00817.38
8.2.60.0040.00417.80
8.2.50.0000.00818.07
8.2.40.0060.00318.22
8.2.30.0060.00318.05
8.2.20.0030.00517.78
8.2.10.0000.00717.89
8.2.00.0040.00417.70
8.1.280.0070.00725.92
8.1.270.0000.00923.97
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0080.00023.77
8.1.230.0110.00020.93
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0080.00017.41
8.1.180.0050.00318.10
8.1.170.0000.00918.59
8.1.160.0000.00722.02
8.1.150.0040.00418.57
8.1.140.0030.00617.34
8.1.130.0070.00017.91
8.1.120.0040.00417.37
8.1.110.0040.00417.52
8.1.100.0080.00017.48
8.1.90.0040.00417.47
8.1.80.0020.00517.53
8.1.70.0000.00717.43
8.1.60.0000.00817.59
8.1.50.0020.00517.45
8.1.40.0000.00917.49
8.1.30.0000.00817.64
8.1.20.0030.00617.66
8.1.10.0030.00617.54
8.1.00.0000.00717.52
8.0.300.0000.00818.77
8.0.290.0000.00717.05
8.0.280.0000.00818.41
8.0.270.0070.00017.34
8.0.260.0100.00016.93
8.0.250.0000.00717.04
8.0.240.0070.00017.06
8.0.230.0030.00517.05
8.0.220.0030.00317.00
8.0.210.0030.00316.96
8.0.200.0030.00317.03
8.0.190.0000.00717.02
8.0.180.0040.00416.87
8.0.170.0040.00416.86
8.0.160.0020.00517.06
8.0.150.0040.00416.84
8.0.140.0000.00716.91
8.0.130.0050.00013.44
8.0.120.0050.00316.82
8.0.110.0040.00416.88
8.0.100.0000.00716.85
8.0.90.0040.00416.85
8.0.80.0080.00816.97
8.0.70.0040.00416.86
8.0.60.0000.00716.95
8.0.50.0040.00416.98
8.0.30.0130.00817.11
8.0.20.0140.00517.40
8.0.10.0000.00717.02
8.0.00.0060.01116.66
7.4.330.0000.00615.07
7.4.320.0000.00616.66
7.4.300.0060.00316.57
7.4.290.0050.00216.52
7.4.280.0000.00716.41
7.4.270.0030.00316.62
7.4.260.0000.00716.61
7.4.250.0040.00416.40
7.4.240.0010.00616.60
7.4.230.0030.00316.68
7.4.220.0180.00716.64
7.4.210.0080.00916.52
7.4.200.0000.00716.62
7.4.190.0030.00316.66
7.4.160.0100.00516.40
7.4.150.0030.01717.40
7.4.140.0140.00717.86
7.4.130.0100.00716.52
7.4.120.0100.01116.60
7.4.110.0080.01516.59
7.4.100.0160.00716.52
7.4.90.0170.00716.70
7.4.80.0090.01316.45
7.4.70.0030.01316.59
7.4.60.0040.01116.45
7.4.50.0040.00416.49
7.4.40.0090.00622.77
7.4.30.0050.01116.50
7.4.00.0000.01814.93
7.3.330.0030.00313.19
7.3.320.0000.00613.44
7.3.310.0030.00316.39
7.3.300.0060.00016.26
7.3.290.0060.00916.39
7.3.280.0050.01016.42
7.3.270.0090.00917.40
7.3.260.0110.00916.68
7.3.250.0130.00616.50
7.3.240.0090.00916.43
7.3.230.0080.00816.39
7.3.210.0090.00916.64
7.3.200.0160.00619.39
7.3.190.0160.00316.37
7.3.180.0090.00816.37
7.3.170.0030.01316.67
7.3.160.0070.01016.56
7.3.120.0080.00414.80
7.3.10.0180.00016.67
7.3.00.0030.01316.64
7.2.330.0070.01016.53
7.2.320.0080.01116.57
7.2.310.0100.00716.64
7.2.300.0030.01416.75
7.2.290.0120.00616.61
7.2.130.0100.01016.86
7.2.120.0110.00716.86
7.2.110.0150.00316.81
7.2.100.0030.01216.93
7.2.90.0110.00416.70
7.2.80.0070.01016.87
7.2.70.0120.00316.62
7.2.60.0140.00516.71
7.2.50.0100.00316.91
7.2.40.0090.00916.79
7.2.30.0040.01417.09
7.2.20.0180.00416.88
7.2.10.0120.00616.85
7.2.00.0050.01018.21
7.1.250.0070.00715.88
7.1.240.0100.01015.74
7.1.230.0180.00315.90
7.1.220.0130.00615.63
7.1.210.0080.00815.33
7.1.200.0080.00815.71
7.1.190.0100.00715.48
7.1.180.0090.00915.56
7.1.170.0100.00715.91
7.1.160.0030.01015.62
7.1.150.0070.00415.66
7.1.140.0140.00315.68
7.1.130.0090.00615.68
7.1.120.0070.00715.51
7.1.110.0090.00615.34
7.1.100.0090.00516.93
7.1.90.0110.00415.60
7.1.80.0070.00715.58
7.1.70.0060.00616.12
7.1.60.0120.00817.67
7.1.50.0090.00316.03
7.1.40.0100.00715.63
7.1.30.0140.00515.61
7.1.20.0190.00415.93
7.1.10.0190.00315.53
7.1.00.0090.03918.88
7.0.330.0120.00615.20
7.0.320.0090.00614.99
7.0.310.0040.01215.19
7.0.300.0170.00415.40
7.0.290.0210.00715.41
7.0.280.0200.00415.63
7.0.270.0200.00315.47
7.0.260.0110.00815.50
7.0.250.0150.00415.39
7.0.240.0100.01315.28
7.0.230.0150.00915.42
7.0.220.0130.01315.43
7.0.210.0120.01215.28
7.0.200.0080.00716.21
7.0.190.0130.01015.18
7.0.180.0130.00415.46
7.0.170.0190.00615.60
7.0.160.0140.00714.88
7.0.150.0210.00815.53
7.0.140.0090.04018.58
7.0.130.0160.00815.55
7.0.120.0200.00315.52
7.0.110.0070.01015.31
7.0.100.0280.03717.71
7.0.90.0090.04017.59
7.0.80.0290.04717.77
7.0.70.0280.04817.53
7.0.60.0270.04417.63
7.0.50.0230.03017.87
7.0.40.0060.03216.75
7.0.30.0080.04416.56
7.0.20.0080.04516.69
7.0.10.0030.04816.76
7.0.00.0080.03316.80
5.6.380.0060.00914.24
5.6.370.0040.00714.07
5.6.360.0060.00914.06
5.6.350.0090.00614.55
5.6.340.0130.00614.20
5.6.330.0000.01514.11
5.6.320.0040.00914.18
5.6.310.0040.00813.95
5.6.300.0070.00414.04
5.6.290.0040.00814.18
5.6.280.0080.03817.64
5.6.270.0070.00314.21
5.6.260.0030.01014.36
5.6.250.0120.04017.41
5.6.240.0020.02817.47
5.6.230.0050.04517.28
5.6.220.0050.04217.27
5.6.210.0100.03817.19
5.6.200.0070.04417.64
5.6.190.0080.02517.77
5.6.180.0100.03217.61
5.6.170.0120.04117.56
5.6.160.0070.04417.43
5.6.150.0100.04317.58
5.6.140.0070.02817.76
5.6.130.0050.04217.72
5.6.120.0100.04017.71
5.6.110.0030.03517.57
5.6.100.0110.04017.51
5.6.90.0070.04917.64
5.6.80.0090.02417.17
5.6.70.0100.04017.13
5.6.60.0110.03817.15
5.6.50.0070.02517.16
5.6.40.0090.04217.08
5.6.30.0060.02617.18
5.6.20.0070.03817.02
5.6.10.0050.02917.04
5.6.00.0060.03917.07
5.5.380.0070.03715.72
5.5.370.0050.04315.74
5.5.360.0080.04015.85
5.5.350.0090.02115.79
5.5.340.0120.04015.76
5.5.330.0020.04615.80
5.5.320.0050.02515.94
5.5.310.0130.03515.97
5.5.300.0110.03615.88
5.5.290.0070.02815.81
5.5.280.0050.03215.90
5.5.270.0130.04015.88
5.5.260.0070.04315.98
5.5.250.0060.04215.81
5.5.240.0070.03815.70
5.5.230.0010.02615.63
5.5.220.0060.04115.64
5.5.210.0090.03315.49
5.5.200.0020.04815.73
5.5.190.0070.04315.72
5.5.180.0030.04215.61
5.5.170.0100.00010.88
5.5.160.0070.03915.56
5.5.150.0080.04215.63
5.5.140.0050.04015.46
5.5.130.0070.04115.55
5.5.120.0050.03715.47
5.5.110.0050.05015.66
5.5.100.0100.02315.40
5.5.90.0130.03015.53
5.5.80.0030.02315.52
5.5.70.0080.04215.46
5.5.60.0030.02815.41
5.5.50.0070.03615.43
5.5.40.0070.02715.46
5.5.30.0060.02415.63
5.5.20.0050.04415.47
5.5.10.0080.03015.55
5.5.00.0070.03015.61
5.4.450.0050.04015.11
5.4.440.0080.02315.10
5.4.430.0050.04515.23
5.4.420.0110.03514.96
5.4.410.0150.03015.02
5.4.400.0050.04015.04
5.4.390.0080.04014.96
5.4.380.0050.02815.09
5.4.370.0070.04314.81
5.4.360.0030.03014.86
5.4.350.0100.03514.88
5.4.340.0050.03814.75
5.4.330.0080.00310.88
5.4.320.0070.03314.99
5.4.310.0040.04715.07
5.4.300.0100.02015.10
5.4.290.0050.04215.05
5.4.280.0060.03014.87
5.4.270.0050.04314.89
5.4.260.0110.02714.96
5.4.250.0070.03914.91
5.4.240.0070.02615.05
5.4.230.0080.02314.96
5.4.220.0000.02514.75
5.4.210.0040.04214.79
5.4.200.0060.03814.79
5.4.190.0070.04114.91
5.4.180.0070.03214.83
5.4.170.0080.03314.98
5.4.160.0090.04214.94
5.4.150.0090.03414.94
5.4.140.0060.02013.82
5.4.130.0070.02113.80
5.4.120.0120.02713.75
5.4.110.0060.03713.86
5.4.100.0100.03613.73
5.4.90.0070.04113.78
5.4.80.0090.02213.57
5.4.70.0120.02013.69
5.4.60.0100.03313.75
5.4.50.0030.04413.81
5.4.40.0050.04413.68
5.4.30.0070.02713.67
5.4.20.0080.03713.73
5.4.10.0060.04613.71
5.4.00.0050.03513.46
5.3.290.0060.03312.67
5.3.280.0030.03012.61
5.3.270.0050.03612.51
5.3.260.0060.02012.61
5.3.250.0070.04012.55
5.3.240.0100.03512.48
5.3.230.0100.04012.55
5.3.220.0050.04012.53
5.3.210.0100.03812.51
5.3.200.0060.03512.51
5.3.190.0040.04412.65
5.3.180.0070.02912.63
5.3.170.0070.03712.72
5.3.160.0120.03512.64
5.3.150.0090.03712.67
5.3.140.0030.03312.57
5.3.130.0080.03312.61
5.3.120.0050.04112.45
5.3.110.0050.04112.63
5.3.100.0100.03812.30
5.3.90.0070.02112.21
5.3.80.0070.04312.29
5.3.70.0050.02512.29
5.3.60.0130.03212.23
5.3.50.0020.04412.29
5.3.40.0050.04012.34
5.3.30.0030.03012.26
5.3.20.0090.03512.13
5.3.10.0060.02411.97
5.3.00.0080.03412.04
5.2.170.0060.04110.62
5.2.160.0070.03510.62
5.2.150.0040.03510.62
5.2.140.0100.03010.62
5.2.130.0060.03210.62
5.2.120.0040.02210.62
5.2.110.0060.01610.62
5.2.100.0030.02810.62
5.2.90.0020.03410.62
5.2.80.0020.03610.62
5.2.70.0030.02110.62
5.2.60.0000.02310.62
5.2.50.0060.02710.62
5.2.40.0020.03710.62
5.2.30.0050.03210.62
5.2.20.0040.03210.62
5.2.10.0070.03010.62
5.2.00.0120.02210.62
5.1.60.0070.02810.62
5.1.50.0020.03010.62
5.1.40.0070.01710.62
5.1.30.0030.02310.62
5.1.20.0050.01510.62
5.1.10.0030.03110.62
5.1.00.0030.01810.62
5.0.50.0030.02310.62
5.0.40.0070.01310.62
5.0.30.0030.02810.62
5.0.20.0040.02010.62
5.0.10.0030.02010.62
5.0.00.0020.03610.62
4.4.90.0020.01510.62
4.4.80.0010.02010.62
4.4.70.0060.01710.62
4.4.60.0070.01110.62
4.4.50.0040.01910.62
4.4.40.0000.03110.62
4.4.30.0050.00810.62
4.4.20.0000.01310.62
4.4.10.0020.01810.62
4.4.00.0020.02410.62
4.3.110.0030.01310.62
4.3.100.0070.00810.62
4.3.90.0020.01310.62
4.3.80.0010.02110.62
4.3.70.0000.01210.62
4.3.60.0020.01610.62
4.3.50.0030.01010.62
4.3.40.0000.02710.62
4.3.30.0060.01310.62
4.3.20.0030.01310.62
4.3.10.0020.00910.62
4.3.00.0020.01710.62

preferences:
80.03 ms | 401 KiB | 5 Q