3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class DbConnection { private $dsn; private $initialized = false; public function __construct($dsn) { $this->dsn = $dsn; } private function init() { $this->initialized = true; // socket stuff happens here, much like with PDO } public function query($queryString) { $this->initialized || $this->init(); // irrelevant from here on return ['query' => $queryString, 'dsn' => $this->dsn]; } } $db_conn = new DbConnection('mysql://something'); var_dump( $db_conn, $db_conn->query('SELECT * FROM foo'), $db_conn->query('SELECT * FROM bar') );

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.0100.01018.43
8.3.50.0100.00921.99
8.3.40.0120.00318.88
8.3.30.0090.00618.82
8.3.20.0040.00420.98
8.3.10.0000.00823.56
8.3.00.0080.00017.38
8.2.180.0130.00318.54
8.2.170.0110.00722.96
8.2.160.0060.00822.20
8.2.150.0050.00324.18
8.2.140.0060.00324.66
8.2.130.0060.00318.16
8.2.120.0040.00426.35
8.2.110.0060.00322.26
8.2.100.0090.00317.84
8.2.90.0040.00420.47
8.2.80.0030.00519.09
8.2.70.0050.00318.03
8.2.60.0000.00817.93
8.2.50.0040.00418.10
8.2.40.0040.00420.53
8.2.30.0040.00419.30
8.2.20.0080.00018.08
8.2.10.0000.00818.06
8.2.00.0020.00517.75
8.1.280.0100.01025.92
8.1.270.0040.00422.71
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0000.00919.09
8.1.230.0110.00022.82
8.1.220.0000.00817.88
8.1.210.0030.00718.92
8.1.200.0050.00317.13
8.1.190.0060.00317.23
8.1.180.0060.00318.10
8.1.170.0040.00420.66
8.1.160.0060.00318.94
8.1.150.0040.00420.31
8.1.140.0050.00219.63
8.1.130.0050.00318.95
8.1.120.0000.00717.36
8.1.110.0050.00317.46
8.1.100.0040.00417.38
8.1.90.0070.00017.38
8.1.80.0000.00817.45
8.1.70.0000.00817.43
8.1.60.0040.00417.49
8.1.50.0030.00717.49
8.1.40.0040.00417.52
8.1.30.0030.00617.65
8.1.20.0030.00617.50
8.1.10.0040.00417.55
8.1.00.0000.00817.45
8.0.300.0040.00419.90
8.0.290.0040.00416.75
8.0.280.0000.00818.51
8.0.270.0070.00017.31
8.0.260.0040.00417.34
8.0.250.0030.00316.97
8.0.240.0080.00017.03
8.0.230.0040.00416.85
8.0.220.0000.00716.89
8.0.210.0000.00716.91
8.0.200.0000.00816.85
8.0.190.0040.00417.02
8.0.180.0030.00516.75
8.0.170.0070.00016.82
8.0.160.0000.00716.90
8.0.150.0000.00716.86
8.0.140.0000.00716.82
8.0.130.0000.00613.31
8.0.120.0000.00816.74
8.0.110.0050.00316.83
8.0.100.0030.00516.80
8.0.90.0000.00716.71
8.0.80.0120.00316.95
8.0.70.0090.00016.75
8.0.60.0040.00416.79
8.0.50.0040.00416.71
8.0.30.0090.01017.10
8.0.20.0140.01017.40
8.0.10.0040.00417.10
8.0.00.0070.01016.59
7.4.330.0020.00215.55
7.4.320.0060.00016.45
7.4.300.0040.00416.53
7.4.290.0040.00516.53
7.4.280.0060.00316.57
7.4.270.0030.00316.66
7.4.260.0070.00016.63
7.4.250.0000.00816.53
7.4.240.0070.00016.61
7.4.230.0080.00016.68
7.4.220.0000.01916.48
7.4.210.0090.00616.72
7.4.200.0070.00016.35
7.4.160.0090.00716.53
7.4.150.0160.00617.40
7.4.140.0070.01117.86
7.4.130.0120.00816.46
7.4.120.0110.01116.58
7.4.110.0100.00716.64
7.4.100.0120.00616.58
7.4.90.0110.00716.57
7.4.80.0100.01019.39
7.4.70.0090.00616.31
7.4.60.0100.01016.55
7.4.50.0020.00816.51
7.4.40.0040.01216.63
7.4.30.0160.00016.57
7.4.10.0030.01414.98
7.4.00.0070.00915.05
7.3.330.0030.00313.37
7.3.320.0000.00613.33
7.3.310.0030.00516.30
7.3.300.0000.00716.29
7.3.290.0060.00816.34
7.3.280.0070.01216.35
7.3.270.0100.00717.40
7.3.260.0090.01116.48
7.3.250.0090.00916.46
7.3.240.0090.00916.45
7.3.230.0100.00716.31
7.3.210.0130.01016.30
7.3.200.0070.01016.38
7.3.190.0060.00916.37
7.3.180.0140.00416.35
7.3.170.0090.00916.37
7.3.160.0060.00916.51
7.3.130.0070.01315.09
7.3.120.0060.01214.46
7.3.110.0030.01714.77
7.3.100.0070.00715.13
7.3.90.0060.00914.64
7.3.80.0040.00815.16
7.3.70.0100.00314.85
7.3.60.0030.01014.77
7.3.50.0090.00314.84
7.3.40.0030.00714.89
7.3.30.0000.01314.82
7.3.20.0070.00416.47
7.3.10.0080.00816.55
7.3.00.0000.00916.58
7.2.330.0140.00616.81
7.2.320.0170.00016.88
7.2.310.0090.00916.46
7.2.300.0060.01216.45
7.2.290.0070.01016.81
7.2.260.0110.00714.93
7.2.250.0080.00315.23
7.2.240.0030.01214.88
7.2.230.0060.00914.69
7.2.220.0090.00915.10
7.2.210.0040.00915.25
7.2.200.0100.00315.27
7.2.190.0070.00714.95
7.2.180.0030.01014.99
7.2.170.0080.00815.14
7.2.160.0000.01414.88
7.2.150.0100.00316.82
7.2.140.0100.00717.15
7.2.130.0040.00816.86
7.2.120.0000.01616.95
7.2.110.0110.00316.85
7.2.100.0100.00616.97
7.2.90.0040.00816.74
7.2.80.0060.00617.12
7.2.70.0090.00616.86
7.2.60.0090.00516.86
7.2.50.0020.00916.80
7.2.40.0070.00716.74
7.2.30.0110.00417.07
7.2.20.0060.00917.03
7.2.10.0030.01517.02
7.2.00.0100.00316.82
7.1.330.0000.01215.77
7.1.320.0030.00915.68
7.1.310.0040.01115.70
7.1.300.0050.00315.74
7.1.290.0080.00315.74
7.1.280.0100.00315.48
7.1.270.0040.00415.94
7.1.260.0030.01215.71
7.1.250.0030.01015.68
7.1.240.0040.01116.02
7.1.230.0000.01315.91
7.1.220.0070.01015.79
7.1.210.0060.00616.01
7.1.200.0080.00515.81
7.1.190.0050.00916.01
7.1.180.0030.00715.80
7.1.170.0040.00715.84
7.1.160.0000.00815.78
7.1.150.0090.00615.76
7.1.140.0100.00315.76
7.1.130.0070.01015.60
7.1.120.0070.00715.91
7.1.110.0120.00315.50
7.1.100.0030.01015.88
7.1.90.0060.00615.84
7.1.80.0030.01015.70
7.1.70.0020.00916.54
7.1.60.0040.00916.47
7.1.50.0070.00416.02
7.1.40.0030.00715.80
7.1.30.0060.00615.79
7.1.20.0030.00615.80
7.1.10.0060.00315.78
7.1.00.0080.04119.23
7.0.330.0000.01115.54
7.0.320.0100.00615.41
7.0.310.0030.01215.55
7.0.300.0130.00015.47
7.0.290.0080.00315.63
7.0.280.0070.00715.59
7.0.270.0100.00315.55
7.0.260.0080.00015.04
7.0.250.0080.00615.35
7.0.240.0000.00915.51
7.0.230.0030.00915.36
7.0.220.0060.00315.48
7.0.210.0110.00415.27
7.0.200.0050.01116.10
7.0.190.0060.00315.30
7.0.180.0000.00915.23
7.0.170.0000.01115.24
7.0.160.0030.01015.36
7.0.150.0030.01015.22
7.0.140.0100.04218.72
7.0.130.0080.03618.74
7.0.120.0090.03318.71
7.0.110.0030.03718.77
7.0.100.0080.04018.76
7.0.90.0080.04518.70
7.0.80.0050.03518.84
7.0.70.0070.03318.83
7.0.60.0060.03718.76
7.0.50.0150.03218.71
7.0.40.0070.03717.77
7.0.30.0170.02517.88
7.0.20.0050.04517.79
7.0.10.0050.04417.74
7.0.00.0020.04417.68
5.6.400.0070.00714.57
5.6.390.0040.00814.63
5.6.380.0040.00714.35
5.6.370.0030.01314.55
5.6.360.0030.01014.55
5.6.350.0060.00614.59
5.6.340.0060.00914.45
5.6.330.0000.01214.39
5.6.320.0040.00714.39
5.6.310.0050.00514.22
5.6.300.0070.00714.70
5.6.290.0080.03317.54
5.6.280.0030.03717.78
5.6.270.0100.02817.79
5.6.260.0070.03217.58
5.6.250.0100.02917.69
5.6.240.0070.04417.65
5.6.230.0020.03717.64
5.6.220.0110.02717.56
5.6.210.0130.04017.66
5.6.200.0070.04217.67
5.6.190.0100.03817.56
5.6.180.0060.03617.51
5.6.170.0110.03717.59
5.6.160.0030.04817.58
5.6.150.0080.04517.64
5.6.140.0070.03817.50
5.6.130.0050.03817.66
5.6.120.0110.03017.71
5.6.110.0100.04017.75
5.6.100.0060.03517.71
5.6.90.0050.03717.51
5.6.80.0070.03117.39
5.6.70.0080.03017.28
5.6.60.0030.03717.39
5.6.50.0080.02617.26
5.6.40.0100.02817.21
5.6.30.0070.03117.46
5.6.20.0090.03017.40
5.6.10.0020.03917.39
5.6.00.0060.04217.45

preferences:
69.51 ms | 401 KiB | 5 Q