3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { protected $id; public static function get() { global $db; $q = $db->query("SELECT * FROM User WHERE `id` = 1"); $q->setFetchMode(PDO::FETCH_CLASS, 'User'); return $q->fetch(); } public function load() { $q = $db->query("SELECT * FROM User WHERE `id` = 1"); $q->setFetchMode(PDO::FETCH_INTO, $this); return $q->fetch(); } } $db = new PDO('sqlite::memory:'); $db->exec("CREATE TABLE User(id INTEGER PRIMARY KEY)"); $db->query("INSERT INTO User VALUES(1)"); // worko var_dump(User::get()); // no-worko $user = new User; var_dump($user->load());

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.0160.00019.59
8.3.30.0040.01121.08
8.3.20.0040.00421.26
8.3.10.0030.00621.84
8.3.00.0080.00023.05
8.2.170.0150.00022.96
8.2.160.0070.00722.99
8.2.150.0000.00824.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0030.00521.63
8.2.110.0030.00722.96
8.2.100.0090.00318.53
8.2.90.0040.00418.78
8.2.80.0080.00018.25
8.2.70.0040.00418.38
8.2.60.0030.00618.43
8.2.50.0040.00418.25
8.2.40.0000.00918.87
8.2.30.0040.00420.15
8.2.20.0040.00418.43
8.2.10.0050.00318.52
8.2.00.0050.00318.47
8.1.270.0040.00423.99
8.1.260.0140.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00321.71
8.1.230.0110.00021.68
8.1.220.0030.00618.51
8.1.210.0080.00019.70
8.1.200.0000.01017.98
8.1.190.0000.00818.16
8.1.180.0090.00018.10
8.1.170.0090.00019.46
8.1.160.0050.00319.61
8.1.150.0000.00919.31
8.1.140.0050.00318.09
8.1.130.0040.00418.63
8.1.120.0000.00818.20
8.1.110.0000.00918.18
8.1.100.0040.00418.22
8.1.90.0070.00018.18
8.1.80.0000.00818.18
8.1.70.0040.00418.21
8.1.60.0090.00018.47
8.1.50.0050.00518.39
8.1.40.0070.00218.34
8.1.30.0090.00018.51
8.1.20.0000.00918.43
8.1.10.0000.00818.45
8.1.00.0030.00618.39
8.0.300.0030.00520.96
8.0.290.0000.00717.91
8.0.280.0000.00719.11
8.0.270.0040.00418.05
8.0.260.0040.00417.54
8.0.250.0000.00817.88
8.0.240.0060.00317.72
8.0.230.0000.00717.84
8.0.220.0040.00417.72
8.0.210.0050.00317.80
8.0.200.0040.00417.80
8.0.190.0030.00617.86
8.0.180.0060.00317.71
8.0.170.0050.00217.68
8.0.160.0000.00717.77
8.0.150.0030.00617.57
8.0.140.0040.00417.66
8.0.130.0030.00514.07
8.0.120.0000.00817.67
8.0.110.0040.00417.73
8.0.100.0050.00317.75
8.0.90.0060.00317.77
8.0.80.0070.01017.71
8.0.70.0000.00817.57
8.0.60.0000.00817.70
8.0.50.0040.00417.46
8.0.30.0120.00917.79
8.0.20.0110.00818.02
8.0.10.0080.00017.89
8.0.00.0110.00817.33
7.4.330.0060.00017.54
7.4.320.0060.00017.38
7.4.300.0080.00017.35
7.4.290.0000.00817.50
7.4.280.0040.00417.30
7.4.270.0000.00817.33
7.4.260.0030.00314.16
7.4.250.0030.00517.36
7.4.240.0040.00417.41
7.4.230.0080.00017.57
7.4.220.0110.01117.30
7.4.210.0050.01117.43
7.4.200.0030.00617.46
7.4.190.0050.00317.33
7.4.160.0150.00317.57
7.4.150.0090.00917.40
7.4.140.0130.00417.86
7.4.130.0110.00817.27
7.4.120.0120.00717.29
7.4.110.0100.01017.40
7.4.100.0110.00817.48
7.4.90.0110.00717.24
7.4.80.0060.01619.39
7.4.70.0070.01117.36
7.4.60.0130.01017.30
7.4.50.0030.00617.16
7.4.40.0090.00522.77
7.4.30.0120.00617.47
7.4.00.0060.00615.91
7.3.330.0020.00414.02
7.3.320.0000.00514.09
7.3.310.0040.00417.11
7.3.300.0000.00717.09
7.3.290.0070.00717.16
7.3.280.0070.01017.20
7.3.270.0070.01117.40
7.3.260.0160.00418.24
7.3.250.0130.00917.19
7.3.240.0100.00917.36
7.3.230.0070.01517.02
7.3.210.0090.00917.26
7.3.200.0100.01619.39
7.3.190.0120.00617.45
7.3.180.0130.01017.18
7.3.170.0100.00817.23
7.3.160.0040.01417.24
7.3.120.0070.00715.78
7.3.110.0100.00715.71
7.3.100.0100.00715.71
7.3.90.0040.01215.35
7.3.80.0060.00615.61
7.3.70.0080.00615.51
7.3.60.0070.01015.57
7.3.50.0000.01115.63
7.3.40.0030.01215.58
7.3.30.0060.01215.44
7.3.20.0100.00717.48
7.3.10.0070.00717.45
7.3.00.0110.00417.24
7.2.330.0080.01117.48
7.2.320.0140.00717.36
7.2.310.0100.01017.49
7.2.300.0210.00417.43
7.2.290.0150.00917.50
7.2.240.0030.01515.73
7.2.230.0030.01015.39
7.2.220.0110.00315.95
7.2.210.0100.00715.71
7.2.200.0030.01315.62
7.2.190.0060.00615.71
7.2.180.0070.01015.84
7.2.170.0040.01115.64
7.2.160.0060.01315.88
7.2.150.0030.01717.52
7.2.140.0160.00317.46
7.2.130.0070.00717.54
7.2.120.0070.01017.30
7.2.110.0070.01417.35
7.2.100.0090.00917.53
7.2.90.0060.01317.59
7.2.80.0100.00617.66
7.2.70.0070.00717.54
7.2.60.0080.00617.61
7.2.50.0070.00717.66
7.2.40.0030.01017.39
7.2.30.0030.01317.64
7.2.20.0060.00917.71
7.2.10.0000.01817.56
7.2.00.0030.01218.72
7.1.330.0040.01416.20
7.1.320.0130.00616.48
7.1.310.0060.00316.36
7.1.300.0070.01116.48
7.1.290.0090.00316.29
7.1.280.0030.01016.11
7.1.270.0070.00716.44
7.1.260.0030.01216.24
7.1.250.0110.00416.33
7.1.200.0040.01116.20
7.1.100.0080.00618.63
7.1.70.0040.00417.69
7.1.60.0170.00719.17
7.1.50.0120.00917.77
7.1.00.0030.03322.63
7.0.200.0230.00715.36
7.0.140.0000.07322.31
7.0.60.0070.07319.95
7.0.50.0100.07717.97
7.0.40.0070.06020.32
7.0.30.0000.04320.38
7.0.20.0370.07020.30
7.0.10.0230.07020.24
7.0.00.0130.07020.29
5.6.210.0100.07320.70
5.6.200.0130.07718.32
5.6.190.0100.08020.55
5.6.180.0130.04720.68
5.6.170.0300.07320.55
5.6.160.0100.07320.52
5.6.150.0000.05718.32
5.6.140.0030.04718.20
5.6.130.0070.05018.20
5.6.120.0100.04021.06
5.6.110.0200.07021.17
5.6.100.0200.07721.20
5.6.90.0070.08320.97
5.6.80.0130.03720.38
5.6.70.3700.04020.57
5.5.350.0070.07720.39
5.5.340.0170.03718.03
5.5.330.0000.04320.38
5.5.320.0430.06320.35
5.5.310.0130.04320.44
5.5.300.0030.05718.07
5.5.290.0070.05018.10
5.5.280.0030.05720.86
5.5.270.0100.04020.80
5.5.260.0030.07020.93
5.5.250.0070.03720.75
5.5.240.0130.06720.22
5.4.450.0270.06319.48
5.4.440.0230.05019.48
5.4.430.0230.04719.65
5.4.420.0370.06019.28
5.4.410.0130.05319.27
5.4.400.0230.04019.21
5.4.390.0270.03319.16
5.4.380.0270.03019.07
5.4.370.0230.07019.25
5.4.360.0200.06318.95
5.4.350.0270.04019.39
5.4.340.0270.06719.13
5.4.320.0000.05019.29
5.4.310.0270.06719.27
5.4.300.0170.07719.23
5.4.290.0230.04318.91
5.4.280.0200.07719.15
5.4.270.0200.04319.29
5.4.260.0200.07319.20
5.4.250.0000.08019.25
5.4.240.0200.07719.31
5.4.230.0230.07719.31
5.4.220.0200.06319.23
5.4.210.0230.04318.90
5.4.200.0270.06719.28
5.4.190.0300.05319.04
5.4.180.0230.04318.89
5.4.170.0200.04719.30
5.4.160.0270.07019.20
5.4.150.0230.04019.22
5.4.140.0200.03316.64
5.4.130.0130.03716.60
5.4.120.0170.05016.49
5.4.110.0130.04016.58
5.4.100.0200.05016.68
5.4.90.0130.06716.36
5.4.80.0130.04316.50
5.4.70.0230.04016.55
5.4.60.0130.03716.50
5.4.50.0170.03716.50
5.4.40.0230.04316.55
5.4.30.0230.07016.30
5.4.20.0200.04316.55
5.4.10.0170.05716.61
5.4.00.0200.04015.88
5.3.290.0200.05014.75
5.3.280.0200.06314.73
5.3.270.0200.04314.60
5.3.260.0170.04014.65
5.3.250.0070.05314.66
5.3.240.0030.06314.75
5.3.230.1030.04014.89
5.3.220.2500.03714.55
5.3.210.2370.03714.76
5.3.200.2170.04014.65
5.3.190.2400.04014.61
5.3.180.2430.03314.54
5.3.170.2270.03314.61
5.3.160.2330.03714.54
5.3.150.2600.05014.55
5.3.140.2500.04314.56
5.3.130.2630.04714.77
5.3.120.2170.04014.77
5.3.110.2600.03714.71
5.3.100.2630.04714.00
5.3.90.2330.04014.07
5.3.80.1770.04314.24
5.3.70.0400.05314.10
5.3.60.0130.04014.23
5.3.50.0070.06314.13
5.3.40.0130.04314.10
5.3.30.0270.05014.00
5.3.20.0100.04013.78
5.3.10.0130.04013.64
5.3.00.0330.03713.82
5.2.170.0170.03311.27
5.2.160.0200.04711.41
5.2.150.0100.03711.24
5.2.140.0270.03311.09
5.2.130.0170.05711.05
5.2.120.0170.03711.15
5.2.110.0070.03311.07
5.2.100.0170.02711.23
5.2.90.0200.03011.07
5.2.80.0270.03311.11
5.2.70.0100.04311.04
5.2.60.0070.03311.04
5.2.50.0100.04311.06
5.2.40.0130.02311.14
5.2.30.0100.03010.93
5.2.20.0130.02711.14
5.2.10.0070.03011.12
5.2.00.0070.03310.68
5.1.60.0230.0209.93
5.1.50.0230.04710.08
5.1.40.0170.0409.96
5.1.30.0200.04310.30
5.1.20.0100.04010.30
5.1.10.0170.03710.15
5.1.00.0170.03010.18
5.0.50.0070.0208.49
5.0.40.0070.0238.46
5.0.30.0030.0338.46
5.0.20.0030.0238.10
5.0.10.0100.0238.08
5.0.00.0070.0338.07
4.4.90.0070.0306.64
4.4.80.0100.0176.64
4.4.70.0100.0336.64
4.4.60.0070.0176.64
4.4.50.0100.0276.64
4.4.40.0030.0306.64
4.4.30.0070.0376.64
4.4.20.0130.0276.64
4.4.10.0030.0306.64
4.4.00.0070.0376.64
4.3.110.0030.0176.64
4.3.100.0100.0106.64
4.3.90.0030.0176.64
4.3.80.0030.0276.64
4.3.70.0070.0136.64
4.3.60.0070.0336.64
4.3.50.0070.0136.64
4.3.40.0070.0276.64
4.3.30.0030.0206.64
4.3.20.0030.0136.64
4.3.10.0030.0136.64
4.3.00.0000.0206.64

preferences:
39.67 ms | 400 KiB | 5 Q