3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Singleton { public static function getInstance() { static $instance = null; if (null === $instance) { $instance = new static(); } return $instance; } abstract protected function __construct(); // prevent new instances using "new" final private function __clone(){} // prevent cloning final private function __wakeup(){} // prevent unserializing } class odb extends Singleton { /*** Credentials ***/ private $sPDOHost = 'localhost'; private $sPDOUser = 'username'; private $sPDOPass = 'password'; private $sPDODB = 'database'; /*** Main Constructor ***/ protected function __construct() { /*try { $this->oPDO = new PDO('mysql:host=' . $this->sPDOHost . ';' . 'dbname=' . $this->sPDODB, $this->sPDOUser, $this->sPDOPass); } catch (PDOException $oEx) { die('MySQL/PDO Connection failed: <br /><pre>' . $oEx->getMessage() . "</pre>"); return false; }*/ echo "hi"; } } $Test = odb::getInstance(); ?>

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.0110.00316.61
8.3.50.0140.00721.93
8.3.40.0140.00718.79
8.3.30.0070.00719.09
8.3.20.0080.00020.35
8.3.10.0030.00523.50
8.3.00.0000.00919.38
8.2.180.0120.00618.29
8.2.170.0130.00322.96
8.2.160.0090.00620.29
8.2.150.0110.00724.18
8.2.140.0070.00024.66
8.2.130.0070.00726.16
8.2.120.0000.00822.03
8.2.110.0050.00520.35
8.2.100.0040.00817.71
8.2.90.0080.00019.21
8.2.80.0000.00817.97
8.2.70.0060.00317.63
8.2.60.0030.00518.04
8.2.50.0030.00618.07
8.2.40.0060.00318.09
8.2.30.0000.00818.12
8.2.20.0000.00817.64
8.2.10.0060.00318.12
8.2.00.0000.01117.75
8.1.270.0040.00422.11
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.01023.86
8.1.230.0060.00622.11
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0000.00917.35
8.1.190.0000.00817.41
8.1.180.0080.00018.10
8.1.170.0040.00418.65
8.1.160.0040.00421.95
8.1.150.0000.00718.59
8.1.140.0000.00717.46
8.1.130.0000.00717.39
8.1.120.0000.00717.48
8.1.110.0050.00317.47
8.1.100.0000.00717.32
8.1.90.0040.00417.27
8.1.80.0000.00717.40
8.1.70.0040.00417.34
8.1.60.0090.00317.59
8.1.50.0040.00417.41
8.1.40.0030.00517.45
8.1.30.0000.00817.52
8.1.20.0040.00417.63
8.1.10.0000.00717.42
8.1.00.0000.00817.43
8.0.300.0000.00718.77
8.0.290.0070.00017.18
8.0.280.0050.00318.49
8.0.270.0000.00717.32
8.0.260.0000.00616.79
8.0.250.0070.00016.96
8.0.240.0040.00416.99
8.0.230.0050.00316.90
8.0.220.0040.00416.86
8.0.210.0050.00316.93
8.0.200.0060.00017.03
8.0.190.0050.00216.95
8.0.180.0040.00416.97
8.0.170.0000.00816.99
8.0.160.0000.00717.00
8.0.150.0030.00316.92
8.0.140.0000.00716.93
8.0.130.0000.00613.39
8.0.120.0050.00316.83
8.0.110.0080.00016.96
8.0.100.0040.00416.90
8.0.90.0080.00016.90
8.0.80.0040.01216.91
8.0.70.0000.00716.98
8.0.60.0050.00316.76
8.0.50.0040.00416.82
8.0.30.0160.00616.98
8.0.20.0160.00617.41
8.0.10.0070.00016.96
8.0.00.0110.00816.62
7.4.330.0030.00315.00
7.4.320.0030.00316.57
7.4.300.0030.00316.42
7.4.290.0030.00316.66
7.4.280.0000.01116.59
7.4.270.0070.00016.55
7.4.260.0050.00316.58
7.4.250.0070.00016.48
7.4.240.0040.00416.55
7.4.230.0070.00016.67
7.4.220.0100.00716.61
7.4.210.0070.01016.54
7.4.200.0030.00316.54
7.4.190.0070.00016.60
7.4.160.0100.01016.66
7.4.150.0150.00417.40
7.4.140.0120.00817.86
7.4.130.0080.00816.59
7.4.120.0120.00516.58
7.4.110.0100.01016.43
7.4.100.0100.01016.44
7.4.90.0090.00916.60
7.4.80.0130.01019.39
7.4.70.0060.01316.53
7.4.60.0030.01316.69
7.4.50.0030.00616.46
7.4.40.0000.01422.77
7.4.30.0080.00816.43
7.4.00.0120.00614.64
7.3.330.0030.00313.32
7.3.320.0030.00213.05
7.3.310.0070.00016.20
7.3.300.0030.00316.16
7.3.290.0030.01016.28
7.3.280.0090.00716.22
7.3.270.0160.00317.40
7.3.260.0120.00316.29
7.3.250.0100.00716.30
7.3.240.0030.01216.49
7.3.230.0060.01116.42
7.3.210.0060.01016.27
7.3.200.0120.00919.39
7.3.190.0060.01316.45
7.3.180.0070.00716.11
7.3.170.0090.01216.29
7.3.160.0060.01016.37
7.3.120.0060.00614.96
7.2.330.0150.00316.79
7.2.320.0000.01816.35
7.2.310.0140.00316.58
7.2.300.0040.01216.48
7.2.290.0090.00916.41
7.2.60.0070.00716.91
7.2.00.0080.00319.41
7.1.200.0060.00315.52
7.1.100.0060.00617.91
7.1.70.0050.00216.81
7.1.60.0100.01319.46
7.1.50.0100.01316.79
7.1.00.0070.07322.36
7.0.200.0070.00716.50
7.0.140.0070.06722.00
7.0.60.0200.07319.90
7.0.50.0030.05017.96
7.0.40.0070.07320.04
7.0.30.0300.06320.16
7.0.20.0230.04320.10
7.0.10.0400.03720.12
7.0.00.0070.09020.18
5.6.280.0000.07721.15
5.6.210.0070.08020.75
5.6.200.0100.03718.19
5.6.190.0100.03720.63
5.6.180.0270.06720.50
5.6.170.0170.04020.50
5.6.160.0070.08320.54
5.6.150.0100.05018.15
5.6.140.0000.04718.28
5.6.130.0030.07318.18
5.6.120.0100.06721.01
5.6.110.0100.07021.14
5.6.100.0030.08321.05
5.6.90.0130.06020.97
5.6.80.0100.04020.48
5.6.70.0400.06020.48
5.5.350.0100.08020.48
5.5.340.0070.07017.94
5.5.330.0070.04020.19
5.5.320.0300.07720.27
5.5.310.0330.07020.24
5.5.300.0000.08318.02
5.5.290.0170.07018.04
5.5.280.0200.07320.97
5.5.270.0000.04720.77
5.5.260.0070.08320.80
5.5.250.0030.04020.70
5.5.240.0130.07320.38
5.4.450.0470.06019.66
5.4.440.0600.06319.20
5.4.430.0100.05719.54
5.4.420.0770.07019.44
5.4.410.1070.06019.24
5.4.400.0600.06019.23
5.4.390.0700.06019.34
5.4.380.0300.03718.73
5.4.370.0100.05718.80
5.4.360.0100.05318.57
5.4.350.0200.07318.86
5.4.340.0070.06318.82
5.4.320.0060.03712.50
5.4.310.0030.03912.50
5.4.300.0040.04112.50
5.4.290.0050.04412.50
5.4.280.0170.06312.38
5.4.270.0220.09512.37
5.4.260.0080.05312.38
5.4.250.0070.04012.37
5.4.240.0050.04312.37
5.4.230.0090.04912.37
5.4.220.0140.09012.36
5.4.210.0300.08412.36
5.4.200.0110.05112.36
5.4.190.0080.07512.36
5.4.180.0080.04012.36
5.4.170.0070.04712.37
5.4.160.0100.04012.37
5.4.150.0090.06112.36
5.4.140.0150.07112.04
5.4.130.0100.06712.04
5.4.120.0180.08311.99
5.4.110.0170.08911.99
5.4.100.0130.05211.98
5.4.90.0450.08611.99
5.4.80.0180.06911.99
5.4.70.0140.05111.99
5.4.60.0110.04611.98
5.4.50.0090.06211.99
5.4.40.0140.06311.97
5.4.30.0100.04611.97
5.4.20.0090.04511.97
5.4.10.0050.06711.96
5.4.00.0090.04611.46
5.3.290.0040.04412.80
5.3.280.0090.04112.70
5.3.270.0060.04412.73
5.3.260.0090.04012.72
5.3.250.0130.03712.72
5.3.240.0110.04012.72
5.3.230.0110.04112.71
5.3.220.0100.03912.68
5.3.210.0060.04412.68
5.3.200.0060.04012.68
5.3.190.0090.04212.68
5.3.180.0120.03812.67
5.3.170.0050.04212.67
5.3.160.0090.03712.68
5.3.150.0130.03612.67
5.3.140.0180.06612.66
5.3.130.0060.04312.66
5.3.120.0080.04512.66
5.3.110.0130.04112.66
5.3.100.0160.05312.12
5.3.90.0070.04212.09
5.3.80.0160.03912.07
5.3.70.0080.03912.07
5.3.60.0100.03812.06
5.3.50.0080.07212.00
5.3.40.0170.06412.00
5.3.30.0090.05611.96
5.3.20.0090.05311.75
5.3.10.0100.04811.70
5.3.00.0110.05611.70
5.2.170.0130.0589.19
5.2.160.0090.0549.19
5.2.150.0020.0499.19
5.2.140.0080.0439.19
5.2.130.0100.0609.14
5.2.120.0050.0589.14
5.2.110.0110.0599.15
5.2.100.0050.0459.14
5.2.90.0080.0639.14
5.2.80.0200.0759.14
5.2.70.0120.0409.14
5.2.60.0070.0429.10
5.2.50.0050.0339.07
5.2.40.0070.0339.04
5.2.30.0050.0339.02
5.2.20.0060.0339.00
5.2.10.0060.0358.92
5.2.00.0090.0278.78
5.1.60.0090.0268.07
5.1.50.0090.0248.07
5.1.40.0100.0248.05
5.1.30.0040.0308.39
5.1.20.0060.0298.43
5.1.10.0080.0288.15
5.1.00.0090.0268.15
5.0.50.0030.0246.61
5.0.40.0040.0276.48
5.0.30.0080.0506.29
5.0.20.0040.0236.26
5.0.10.0190.0766.23
5.0.00.0030.0356.22
4.4.90.0090.0364.78
4.4.80.0110.0464.76
4.4.70.0060.0354.76
4.4.60.0160.0404.75
4.4.50.0150.0344.77
4.4.40.0090.0594.71
4.4.30.0110.0394.76
4.4.20.0130.0374.84
4.4.10.0070.0354.85
4.4.00.0110.0484.76
4.3.110.0080.0484.67
4.3.100.0120.0514.66
4.3.90.0050.0224.63
4.3.80.0070.0704.59
4.3.70.0120.0494.63
4.3.60.0040.0304.63
4.3.50.0060.0424.63
4.3.40.0020.0554.54
4.3.30.0110.0443.27
4.3.20.0060.0373.25
4.3.10.0000.0273.21
4.3.00.0170.01710.30

preferences:
33.91 ms | 400 KiB | 5 Q