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(); 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.40.0090.00618.86
8.3.30.0120.00318.95
8.3.20.0040.00420.29
8.3.10.0050.00323.53
8.3.00.0040.00420.64
8.2.170.0060.01222.96
8.2.160.0030.01022.08
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0050.00222.08
8.2.110.0030.00622.19
8.2.100.0040.00917.84
8.2.90.0080.00019.36
8.2.80.0090.00018.05
8.2.70.0060.00317.75
8.2.60.0050.00318.05
8.2.50.0040.00418.07
8.2.40.0080.00019.46
8.2.30.0000.00718.20
8.2.20.0040.00417.66
8.2.10.0030.00617.80
8.2.00.0040.00417.69
8.1.270.0050.00323.92
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0090.00023.90
8.1.230.0040.00819.04
8.1.220.0000.00817.78
8.1.210.0040.00418.77
8.1.200.0060.00317.36
8.1.190.0030.00517.55
8.1.180.0090.00018.10
8.1.170.0000.00818.61
8.1.160.0000.00822.03
8.1.150.0040.00418.64
8.1.140.0000.00717.45
8.1.130.0070.00017.82
8.1.120.0000.00717.38
8.1.110.0050.00317.36
8.1.100.0000.00717.51
8.1.90.0040.00417.34
8.1.80.0050.00217.36
8.1.70.0040.00417.38
8.1.60.0060.00617.48
8.1.50.0040.00417.56
8.1.40.0000.00817.56
8.1.30.0000.00817.70
8.1.20.0050.00317.62
8.1.10.0000.00817.46
8.1.00.0050.00217.56
8.0.300.0090.00018.77
8.0.290.0000.00817.18
8.0.280.0070.00018.48
8.0.270.0030.00317.31
8.0.260.0040.00416.76
8.0.250.0000.00616.98
8.0.240.0000.00716.89
8.0.230.0040.00417.06
8.0.220.0000.00816.87
8.0.210.0030.00316.95
8.0.200.0070.00016.89
8.0.190.0040.00417.10
8.0.180.0000.00916.87
8.0.170.0040.00417.00
8.0.160.0040.00417.02
8.0.150.0030.00616.86
8.0.140.0000.00716.98
8.0.130.0030.00313.43
8.0.120.0030.00716.88
8.0.110.0050.00316.93
8.0.100.0070.00016.90
8.0.90.0070.00016.85
8.0.80.0060.01016.88
8.0.70.0020.00516.75
8.0.60.0070.00016.79
8.0.50.0040.00416.79
8.0.30.0120.01117.23
8.0.20.0100.01017.40
8.0.10.0020.00516.96
8.0.00.0120.00816.77
7.4.330.0050.00015.09
7.4.320.0000.00616.61
7.4.300.0000.00616.59
7.4.290.0030.00316.53
7.4.280.0040.00416.61
7.4.270.0000.00716.60
7.4.260.0030.00316.56
7.4.250.0080.00016.57
7.4.240.0030.00416.57
7.4.230.0000.00716.31
7.4.220.0120.00616.45
7.4.210.0070.00716.68
7.4.200.0030.00316.41
7.4.190.0070.00016.73
7.4.160.0090.00616.39
7.4.150.0150.00917.40
7.4.140.0090.00917.86
7.4.130.0140.00516.47
7.4.120.0100.00716.56
7.4.110.0080.00816.45
7.4.100.0170.00016.66
7.4.90.0090.00916.48
7.4.80.0140.00416.46
7.4.70.0100.01316.58
7.4.60.0100.00716.33
7.4.50.0040.00416.42
7.4.40.0030.01022.77
7.4.30.0100.00716.32
7.4.00.0090.00814.98
7.3.330.0000.00513.45
7.3.320.0000.00613.35
7.3.310.0030.00516.32
7.3.300.0070.00016.44
7.3.290.0110.00416.44
7.3.280.0090.01016.42
7.3.270.0120.00617.40
7.3.260.0130.01016.34
7.3.250.0170.00716.41
7.3.240.0100.00716.43
7.3.230.0080.00816.53
7.3.210.0190.00616.36
7.3.200.0210.00319.39
7.3.190.0090.01516.41
7.3.180.0070.01016.45
7.3.170.0090.00616.59
7.3.160.0080.01216.55
7.3.120.0060.01114.82
7.3.110.0040.01514.96
7.3.100.0100.00314.66
7.3.90.0090.00614.89
7.3.80.0030.00914.53
7.3.70.0060.00914.72
7.3.60.0030.01014.73
7.3.50.0070.00714.90
7.3.40.0070.00714.61
7.3.30.0110.00014.65
7.3.20.0060.00616.46
7.3.10.0040.01116.63
7.3.00.0000.01516.70
7.2.330.0110.00616.68
7.2.320.0140.00916.49
7.2.310.0060.01116.79
7.2.300.0070.01016.80
7.2.290.0100.01616.84
7.2.250.0070.01014.95
7.2.240.0070.01315.00
7.2.230.0070.00715.17
7.2.220.0000.01615.14
7.2.210.0090.00315.03
7.2.200.0040.00714.84
7.2.190.0000.00915.11
7.2.180.0040.01114.76
7.2.170.0070.00715.01
7.2.60.0090.00316.95
7.2.00.0050.01118.90
7.1.330.0060.00615.90
7.1.320.0040.01115.64
7.1.310.0060.00915.92
7.1.300.0030.00615.80
7.1.290.0060.01015.69
7.1.280.0030.01015.88
7.1.270.0030.00915.64
7.1.260.0030.01015.69
7.1.200.0110.00415.80
7.1.100.0000.01618.35
7.1.70.0000.00817.18
7.1.60.0100.00317.19
7.1.50.0030.01917.01
7.1.00.0100.07022.45
7.0.200.0030.01416.96
7.0.140.0000.07722.09
7.0.60.0100.07719.93
7.0.50.0130.03017.95
7.0.40.0130.06720.04
7.0.30.0270.04720.20
7.0.20.0270.08020.05
7.0.10.0000.04720.06
7.0.00.0130.07320.19
5.6.280.0070.07320.91
5.6.210.0030.07320.51
5.6.200.0030.05718.18
5.6.190.0070.07320.68
5.6.180.0530.07020.60
5.6.170.0230.06320.56
5.6.160.0070.03720.50
5.6.150.0030.04718.25
5.6.140.0130.07718.11
5.6.130.0130.04318.20
5.6.120.0030.04720.99
5.6.110.0030.08020.99
5.6.100.0170.07721.00
5.6.90.0070.08021.00
5.6.80.0130.07720.43
5.5.350.0130.08320.38
5.5.340.0070.05317.95
5.5.330.0000.04320.35
5.5.320.0030.06720.20
5.5.310.0230.05320.32
5.5.300.0030.07017.96
5.5.290.0070.06717.94
5.5.280.0070.05020.78
5.5.270.0100.08020.89
5.5.260.0100.08320.73
5.5.250.0070.07720.59
5.5.240.0030.07320.14
5.4.450.0270.04019.56
5.4.440.0230.04319.27
5.4.430.0270.04319.44
5.4.420.0470.03019.18
5.4.410.0330.04719.43
5.4.400.0300.03319.20
5.4.390.0230.04019.20
5.4.380.0230.04019.16
5.4.370.0230.04018.86
5.4.360.0330.03719.08
5.4.350.0330.04319.08
5.4.340.0300.03319.31
5.4.320.0370.04019.11
5.4.310.0600.02719.08
5.4.300.0270.03718.97
5.4.290.0270.03719.17
5.4.280.0370.04019.22
5.4.270.0270.03719.16
5.4.260.0230.04018.83
5.4.250.0370.03318.95
5.4.240.0300.03319.13
5.4.230.0230.04019.11
5.4.220.0270.03718.83
5.4.210.0300.03318.96
5.4.200.0300.03319.07
5.4.190.0400.03319.15
5.4.180.0300.04319.13
5.4.170.0400.03319.18
5.4.160.0300.03019.03
5.4.150.0300.07319.17
5.4.140.0270.04016.46
5.4.130.0430.03016.37
5.4.120.0230.03716.50
5.4.110.0270.03316.64
5.4.100.0400.06016.50
5.4.90.0300.04716.61
5.4.80.0330.03716.22
5.4.70.0370.06716.28
5.4.60.0470.06016.48
5.4.50.0300.03716.50
5.4.40.0270.07716.32
5.4.30.0200.04716.53
5.4.20.0300.04016.42
5.4.10.0270.03716.51
5.4.00.0270.07315.95
5.3.290.0270.04314.59
5.3.280.0370.06714.50
5.3.270.0330.05714.69
5.3.260.0300.03714.58
5.3.250.0300.07314.63
5.3.240.0300.06714.72
5.3.230.0330.05314.58
5.3.220.0430.06314.69
5.3.210.0400.05314.68
5.3.200.0300.04014.65
5.3.190.0330.03314.54
5.3.180.0430.06014.57
5.3.170.0330.07714.48
5.3.160.0370.03714.54
5.3.150.0300.05014.62
5.3.140.0300.05714.47
5.3.130.0230.05314.55
5.3.120.0370.05014.54
5.3.110.0330.02714.63
5.3.100.0300.07313.96
5.3.90.0270.04314.07
5.3.80.0270.04313.94
5.3.70.0230.04713.93
5.3.60.0300.03314.23
5.3.50.0370.04713.91
5.3.40.0370.05313.95
5.3.30.0400.07014.14
5.3.20.0430.04313.78
5.3.10.0530.04313.58
5.3.00.0370.04313.76
5.2.170.0430.05312.22
5.2.160.0200.04012.22
5.2.150.0200.03312.22
5.2.140.0230.03012.22
5.2.130.0270.04012.22
5.2.120.0230.03012.22
5.2.110.0270.04312.22
5.2.100.0330.05712.22
5.2.90.0270.04012.22
5.2.80.0300.03312.22
5.2.70.0300.04312.22
5.2.60.0330.03012.22
5.2.50.0300.03712.22
5.2.40.0200.03712.22
5.2.30.0200.06012.22
5.2.20.0170.03012.22
5.2.10.0300.04712.22
5.2.00.0270.03312.22
5.1.60.0270.05012.22
5.1.50.0230.03312.22
5.1.40.0170.03012.22
5.1.30.0230.02312.22
5.1.20.0030.06012.22
5.1.10.0170.04012.22
5.1.00.0200.04312.22
5.0.50.0100.03312.22
5.0.40.0100.02712.22
5.0.30.0100.06312.22
5.0.20.0130.01712.22
5.0.10.0070.02012.22
5.0.00.0130.05012.22
4.4.90.0200.02312.22
4.4.80.0130.02312.22
4.4.70.0170.03712.22
4.4.60.0100.01712.22
4.4.50.0130.03712.22
4.4.40.0130.02312.22
4.4.30.0230.02712.22
4.4.20.0130.02712.22
4.4.10.0100.03012.22
4.4.00.0130.05012.22
4.3.110.0170.02012.22
4.3.100.0100.01712.22
4.3.90.0170.01712.22
4.3.80.0170.02312.22
4.3.70.0170.03012.22
4.3.60.0100.02712.22
4.3.50.0170.03312.22
4.3.40.0200.03012.22
4.3.30.0070.03712.22
4.3.20.0130.03312.22
4.3.10.0070.03012.22
4.3.00.0100.02012.22

preferences:
42.99 ms | 400 KiB | 5 Q