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 $class = get_called_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.0150.00418.56
8.3.60.0100.00618.66
8.3.50.0130.00622.11
8.3.40.0140.00718.96
8.3.30.0070.00719.02
8.3.20.0040.00418.86
8.3.10.0050.00321.22
8.3.00.0040.00423.61
8.2.180.0180.00318.29
8.2.170.0110.00422.96
8.2.160.0000.01320.30
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0070.00418.03
8.2.110.0070.00320.51
8.2.100.0090.00317.91
8.2.90.0040.00417.75
8.2.80.0080.00018.91
8.2.70.0040.00417.75
8.2.60.0030.00617.63
8.2.50.0030.00617.73
8.2.40.0000.00819.35
8.2.30.0030.00519.79
8.2.20.0040.00417.85
8.2.10.0070.00017.87
8.2.00.0040.00417.82
8.1.280.0110.00425.92
8.1.270.0060.00323.99
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0060.00319.01
8.1.230.0110.00017.89
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0030.00617.48
8.1.190.0000.00817.23
8.1.180.0050.00318.10
8.1.170.0000.00817.62
8.1.160.0040.00418.82
8.1.150.0040.00418.67
8.1.140.0080.00017.45
8.1.130.0030.00317.74
8.1.120.0070.00017.36
8.1.110.0030.00517.37
8.1.100.0000.00717.34
8.1.90.0070.00017.46
8.1.80.0000.00717.38
8.1.70.0030.00317.35
8.1.60.0040.00717.65
8.1.50.0040.00417.38
8.1.40.0050.00317.57
8.1.30.0040.00417.55
8.1.20.0030.00617.69
8.1.10.0040.00417.50
8.1.00.0000.00717.57
8.0.300.0070.00018.77
8.0.290.0070.00016.75
8.0.280.0030.00318.36
8.0.270.0070.00017.27
8.0.260.0030.00516.90
8.0.250.0040.00416.99
8.0.240.0000.00816.91
8.0.230.0000.00717.07
8.0.220.0000.00716.90
8.0.210.0030.00316.95
8.0.200.0000.00717.07
8.0.190.0000.00717.00
8.0.180.0040.00417.01
8.0.170.0000.00817.00
8.0.160.0030.00316.86
8.0.150.0090.00016.79
8.0.140.0070.00016.92
8.0.130.0000.00813.32
8.0.120.0000.00716.88
8.0.110.0000.00716.80
8.0.100.0040.00417.05
8.0.90.0080.00016.84
8.0.80.0030.01316.96
8.0.70.0000.00716.91
8.0.60.0000.00716.85
8.0.50.0050.00216.96
8.0.30.0140.00617.03
8.0.20.0080.01017.40
8.0.10.0000.00917.13
8.0.00.0150.00816.70
7.4.330.0000.00514.76
7.4.320.0030.00316.66
7.4.300.0070.00016.56
7.4.290.0070.00016.60
7.4.280.0070.00016.47
7.4.270.0050.00316.44
7.4.260.0000.00513.23
7.4.250.0040.00416.53
7.4.240.0020.00516.63
7.4.230.0070.00016.63
7.4.220.0110.00716.70
7.4.210.0060.00816.56
7.4.200.0000.00816.54
7.4.190.0040.00416.74
7.4.160.0030.01416.57
7.4.150.0030.01517.40
7.4.140.0100.01017.86
7.4.130.0090.00916.57
7.4.120.0100.00716.62
7.4.110.0100.01016.47
7.4.100.0100.00716.32
7.4.90.0080.00816.45
7.4.80.0030.01619.37
7.4.70.0110.01516.41
7.4.60.0060.01616.35
7.4.50.0000.00916.15
7.4.40.0070.00722.52
7.4.30.0140.00316.41
7.4.00.0080.00614.95
7.3.330.0000.00513.25
7.3.320.0040.00413.29
7.3.310.0060.00316.46
7.3.300.0030.00316.47
7.3.290.0030.01216.39
7.3.280.0100.00716.39
7.3.270.0180.00017.40
7.3.260.0100.01118.24
7.3.250.0150.00416.37
7.3.240.0090.00916.64
7.3.230.0170.00016.41
7.3.210.0120.00616.36
7.3.200.0140.00719.39
7.3.190.0170.00016.48
7.3.180.0060.00916.63
7.3.170.0100.00716.68
7.3.160.0130.00316.43
7.3.120.0080.00914.87
7.3.110.0100.00714.86
7.3.100.0000.01814.92
7.3.90.0030.01214.83
7.3.80.0070.00714.54
7.3.70.0000.01114.96
7.3.60.0070.00414.79
7.3.50.0040.00714.78
7.3.40.0060.00614.73
7.3.30.0110.00414.62
7.3.20.0000.00916.53
7.3.10.0080.01116.29
7.3.00.0070.01216.50
7.2.330.0110.00716.86
7.2.320.0090.00916.48
7.2.310.0170.00716.61
7.2.300.0160.00016.79
7.2.290.0090.00916.52
7.2.250.0120.00615.06
7.2.240.0100.01014.92
7.2.230.0100.01014.99
7.2.220.0050.00515.10
7.2.210.0090.00314.95
7.2.200.0120.00015.19
7.2.190.0100.00315.09
7.2.180.0070.01115.08
7.2.170.0060.00915.09
7.2.130.0230.00616.61
7.2.120.0160.00416.39
7.2.110.0170.00916.79
7.2.100.0180.01416.74
7.2.90.0120.01416.12
7.2.80.0150.01216.44
7.2.70.0140.00916.41
7.2.60.0110.01816.45
7.2.50.0240.00616.78
7.2.40.0150.01216.39
7.2.30.0160.00616.09
7.2.20.0170.00816.51
7.2.10.0090.00916.43
7.2.00.0050.01418.12
7.1.330.0070.01016.12
7.1.320.0060.00615.82
7.1.310.0030.00515.69
7.1.300.0000.01415.71
7.1.290.0030.00615.64
7.1.280.0040.00915.83
7.1.270.0040.00415.70
7.1.260.0130.00315.57
7.1.250.0170.00715.50
7.1.100.0070.00717.90
7.1.70.0000.00817.00
7.1.60.0070.01019.40
7.1.50.0070.01717.09
7.1.00.0000.06322.32
7.0.200.0040.00416.80
7.0.140.0000.07322.00
7.0.110.0000.04019.96
7.0.100.0100.07020.10
7.0.90.0070.08019.89
7.0.80.0170.06020.05
7.0.70.0030.06019.89
7.0.60.0030.07020.00
7.0.50.0070.04719.98
7.0.40.0100.06719.87
7.0.30.0130.07719.74
7.0.20.0030.05019.87
7.0.10.0100.05019.87
7.0.00.0000.04319.71
5.6.280.0070.07021.11
5.6.260.0100.07320.71
5.6.250.0030.04020.60
5.6.240.0030.07020.56
5.6.230.0070.03720.71
5.6.220.0030.08320.53
5.6.210.0030.05720.63
5.6.200.0130.07720.59
5.6.190.0030.08720.61
5.6.180.0030.07720.55
5.6.170.0100.06320.63
5.6.160.0100.06320.55
5.6.150.0030.05020.61
5.6.140.0070.04020.65
5.6.130.0030.04020.69
5.6.120.0000.04320.51
5.6.110.0070.04020.60
5.6.100.0070.03720.55
5.6.90.0030.04020.59
5.6.80.0000.04020.08
5.6.70.0030.03720.02
5.6.60.0070.08020.01
5.6.50.0100.04320.02
5.6.40.0030.04719.97
5.6.30.0070.03320.16
5.6.20.0030.03720.21
5.6.10.0030.04019.81
5.6.00.0030.06020.00
5.5.380.0030.07017.56
5.5.370.0000.04317.54
5.5.360.0100.03317.68
5.5.350.0000.06017.77
5.5.340.0030.03717.83
5.5.330.0070.07317.93
5.5.320.0100.08017.96
5.5.310.0100.07317.93
5.5.300.0100.04018.22
5.5.290.0030.04017.83
5.5.280.0070.07317.97
5.5.270.0000.03717.89
5.5.260.0030.03718.25
5.5.250.0030.04317.74
5.5.240.0030.04017.50
5.5.230.0030.03717.29
5.5.220.0030.08017.28
5.5.210.0070.04017.46
5.5.200.0070.03017.28
5.5.190.0100.03017.43
5.5.180.0030.05017.58
5.5.160.0100.05717.47
5.5.150.0100.02717.45
5.5.140.0070.06717.26
5.5.130.0070.03717.28
5.5.120.0030.03317.57
5.5.110.0030.04017.43
5.5.100.0000.07317.48
5.5.90.0070.07317.34
5.5.80.0070.03317.08
5.5.70.0130.04317.29
5.5.60.0070.04017.34
5.5.50.0070.03717.34
5.5.40.0030.04717.15
5.5.30.0030.04017.09
5.5.20.0030.06017.36
5.5.10.0000.04017.19
5.5.00.0000.04317.16
5.4.450.0100.03719.32
5.4.440.0030.08319.36
5.4.430.0070.03319.32
5.4.420.0130.03019.41
5.4.410.0070.05019.14
5.4.400.0070.07719.34
5.4.390.0030.03319.01
5.4.380.0000.04018.98
5.4.370.0030.06019.01
5.4.360.0000.04019.01
5.4.350.0070.06018.96
5.4.340.0030.04019.32
5.4.320.0070.06319.32
5.4.310.0030.06319.35
5.4.300.0070.04019.22
5.4.290.0000.03719.16
5.4.280.0070.08019.01
5.4.270.0030.05718.95
5.4.260.0130.07018.99
5.4.250.0030.04018.94
5.4.240.0030.05019.01
5.4.230.0070.03719.23
5.4.220.0100.03319.00
5.4.210.0000.06718.98
5.4.200.0100.06719.08
5.4.190.0030.06318.94
5.4.180.0100.03719.13
5.4.170.0100.05719.17
5.4.160.0030.05019.16
5.4.150.0030.03719.11
5.4.140.0030.03316.59
5.4.130.0000.04316.36
5.4.120.0070.03716.58
5.4.110.0000.07316.55
5.4.100.0000.05716.42
5.4.90.0030.06716.48
5.4.80.0100.07316.35
5.4.70.0100.04016.51
5.4.60.0070.06316.54
5.4.50.0070.07016.23
5.4.40.0070.06016.53
5.4.30.0100.06016.52
5.4.20.0030.04016.56
5.4.10.0030.05016.40
5.4.00.0130.05315.79
5.3.290.0130.06314.68
5.3.280.0130.06314.68
5.3.270.0000.06314.64
5.3.260.0030.05014.46
5.3.250.0070.03314.73
5.3.240.0130.06314.69
5.3.230.0000.03314.55
5.3.220.0030.05314.65
5.3.210.0130.04714.54
5.3.200.0100.07014.58
5.3.190.0030.07314.71
5.3.180.0070.08014.79
5.3.170.0030.07314.58
5.3.160.0070.07314.59
5.3.150.0100.03014.67
5.3.140.0030.06714.69
5.3.130.0030.04714.78
5.3.120.0070.07714.69
5.3.110.0130.07014.56
5.3.100.0170.06014.05
5.3.90.0070.05714.15
5.3.80.0070.05014.01
5.3.70.0030.05714.24
5.3.60.0070.06714.04
5.3.50.0000.04714.18
5.3.40.0100.07013.95
5.3.30.0030.04013.95
5.3.20.0130.06013.70
5.3.10.0100.04713.52
5.3.00.0030.06013.66
5.2.170.0000.04012.59
5.2.160.0030.04012.59
5.2.150.0030.06312.59
5.2.140.0070.05012.59
5.2.130.0000.03012.59
5.2.120.0000.03312.59
5.2.110.0100.03712.59
5.2.100.0070.05012.59
5.2.90.0100.05312.59
5.2.80.0000.02712.59
5.2.70.0100.06012.59
5.2.60.0000.06312.59
5.2.50.0000.02712.59
5.2.40.0000.03312.59
5.2.30.0070.05012.59
5.2.20.0000.03712.59
5.2.10.0000.03012.59
5.2.00.0000.05012.59
5.1.60.0000.05012.59
5.1.50.0000.02712.59
5.1.40.0030.02712.59
5.1.30.0100.03012.59
5.1.20.0000.02712.59
5.1.10.0030.04312.59
5.1.00.0000.03712.59
5.0.50.0030.02312.59
5.0.40.0030.01712.59
5.0.30.0030.02712.59
5.0.20.0030.04012.59
5.0.10.0000.04012.59
5.0.00.0070.02012.59
4.4.90.0000.03012.59
4.4.80.0030.02712.59
4.4.70.0000.02012.59
4.4.60.0030.02312.59
4.4.50.0070.03312.59
4.4.40.0000.02312.59
4.4.30.0000.01312.59
4.4.20.0000.03312.59
4.4.10.0030.02712.59
4.4.00.0030.03312.59
4.3.110.0030.01012.59
4.3.100.0000.03712.59
4.3.90.0000.02312.59
4.3.80.0000.02312.59
4.3.70.0000.02712.59
4.3.60.0000.01712.59
4.3.50.0000.01712.59
4.3.40.0000.03312.59
4.3.30.0030.01012.59
4.3.20.0030.03312.59
4.3.10.0030.03312.59
4.3.00.0000.03012.59

preferences:
58.71 ms | 401 KiB | 5 Q