3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Database { protected static $instance; protected $pdo; protected $lastExecute; protected function __construct() { $this->pdo = new PDO('sqlite::memory:'); } public static function instance() { if (null === self::$instance) { self::$instance = new self; } return self::$instance; } /** * @return PDOStatement|false */ public function run($sql, $args = []) { if (!$args) { return $this->pdo->query($sql); } if ($stmt = $this->pdo->prepare($sql)) { $this->lastExecute = $stmt->execute($args); } return $stmt; } /** * @return null|bool */ public function getLastExecute() { return $this->lastExecute; } public function __call($method, $args) { if (is_callable([$this->pdo, $method])) { //php 5.6+ variadic optimization (aka splat operator) return $this->pdo->$method(...$args); //PHP <= 5.5 //return call_user_func_array(array($this->pdo, $method), $args); } throw new \BadMethodCallException(sprintf('Unknown method PDO::%s called!', $method)); } } //RunTime code $db = Database::instance(); $db->run('SELECT ?', ['foo', 'bar']); var_dump($db->getLastExecute()); //false

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.130.0030.00619.18
8.3.120.0040.00719.80
8.3.110.0060.00920.94
8.3.100.0060.00317.28
8.3.90.0090.00026.77
8.3.80.0040.00719.31
8.3.70.0090.00619.18
8.3.60.0100.01019.05
8.3.50.0110.00717.26
8.3.40.0120.00319.77
8.3.30.0070.00719.77
8.3.20.0040.00421.83
8.3.10.0030.00521.10
8.3.00.0040.00424.05
8.2.250.0040.00417.61
8.2.240.0040.00420.06
8.2.230.0030.00622.58
8.2.220.0070.01024.06
8.2.210.0060.01226.77
8.2.200.0100.00017.63
8.2.190.0090.00617.75
8.2.180.0040.01117.35
8.2.170.0110.01122.96
8.2.160.0040.01121.27
8.2.150.0030.00724.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0050.00320.51
8.2.110.0070.00321.79
8.2.100.0070.00419.96
8.2.90.0030.00718.78
8.2.80.0060.00318.68
8.2.70.0000.00918.79
8.2.60.0000.00818.78
8.2.50.0040.00418.66
8.2.40.0050.00520.11
8.2.30.0040.00420.02
8.2.20.0060.00618.90
8.2.10.0030.00521.46
8.2.00.0040.00420.08
8.1.300.0060.00318.71
8.1.290.0070.00330.84
8.1.280.0130.00625.92
8.1.270.0040.00423.21
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0090.00023.08
8.1.230.0060.00621.62
8.1.220.0030.00518.40
8.1.210.0060.00319.41
8.1.200.0120.00018.23
8.1.190.0030.00617.98
8.1.180.0050.00318.28
8.1.170.0080.00019.40
8.1.160.0000.00719.66
8.1.150.0000.00719.71
8.1.140.0030.00519.72
8.1.130.0000.00720.00
8.1.120.0000.00718.20
8.1.110.0050.00218.15
8.1.100.0000.00818.25
8.1.90.0040.00418.16
8.1.80.0030.00618.28
8.1.70.0030.00518.13
8.1.60.0050.00318.46
8.1.50.0000.00818.38
8.1.40.0060.00318.38
8.1.30.0060.00318.43
8.1.20.0040.00418.46
8.1.10.0000.00818.38
8.1.00.0000.00918.25
8.0.300.0080.00020.64
8.0.290.0080.00017.50
8.0.280.0070.00019.27
8.0.270.0060.00317.74
8.0.260.0040.00417.59
8.0.250.0080.00017.88
8.0.240.0000.00717.88
8.0.230.0000.00717.88
8.0.220.0030.00317.84
8.0.210.0000.00817.84
8.0.200.0030.00517.78
8.0.190.0060.00317.83
8.0.180.0000.00817.80
8.0.170.0030.00617.62
8.0.160.0070.00017.66
8.0.150.0000.00717.71
8.0.140.0040.00417.71
8.0.130.0060.00014.12
8.0.120.0040.00417.74
8.0.110.0050.00317.82
8.0.100.0000.00817.75
8.0.90.0000.00717.61
8.0.80.0120.00617.67
8.0.70.0000.00717.52
8.0.60.0050.00317.76
8.0.50.0050.00317.56
8.0.30.0100.00917.98
8.0.20.0150.00317.80
8.0.10.0080.00017.81
8.0.00.0070.01017.63
7.4.330.0050.00015.88
7.4.320.0000.00817.33
7.4.300.0030.00317.35
7.4.290.0080.00017.20
7.4.280.0000.01117.33
7.4.270.0030.00317.32
7.4.260.0050.00317.25
7.4.250.0040.00417.13
7.4.240.0020.00517.31
7.4.230.0000.00717.37
7.4.220.0000.00817.21
7.4.210.0070.00817.34
7.4.200.0050.00317.46
7.4.160.0090.00917.41
7.4.130.0090.01217.42
7.4.120.0090.00917.31
7.4.110.0090.00917.32
7.4.100.0150.00417.42
7.4.90.0070.01017.27
7.4.80.0110.00619.39
7.4.70.0120.00817.34
7.4.60.0080.00817.40
7.4.50.0060.01017.18
7.4.40.0090.00917.34
7.4.00.0080.00815.89
7.3.330.0000.00614.12
7.3.320.0030.00314.14
7.3.310.0080.00017.13
7.3.300.0000.00717.09
7.3.290.0090.00617.10
7.3.280.0070.01017.14
7.3.260.0080.01117.20
7.3.240.0080.01117.29
7.3.230.0120.00617.21
7.3.210.0100.00717.12
7.3.200.0100.00717.05
7.3.190.0060.01317.43
7.3.180.0070.01017.09
7.3.170.0090.01517.09
7.3.160.0080.00817.12
7.3.50.0090.01215.54
7.3.40.0100.01315.47
7.3.30.0100.01315.32
7.3.20.0100.00715.52
7.3.10.0130.00315.40
7.3.00.0180.00015.51
7.2.330.0090.00917.39
7.2.320.0070.01017.44
7.2.310.0100.00717.54
7.2.300.0130.00417.41
7.2.290.0090.00917.51
7.2.180.0140.00715.88
7.2.170.0100.00315.59
7.2.160.0080.01515.59
7.2.150.0180.00915.77
7.2.140.0100.01715.86
7.2.130.0170.00315.95
7.2.120.0130.00315.82
7.2.110.0270.00615.75
7.2.100.0180.00915.74
7.2.90.0140.00715.72
7.2.80.0150.01215.75
7.2.70.0110.01115.58
7.2.60.0200.00715.77
7.2.50.0070.01115.84
7.2.40.0150.00015.85
7.2.30.0130.01315.89
7.2.20.0170.00415.61
7.2.10.0170.00315.79
7.2.00.0130.00315.83
7.1.280.0180.00014.45
7.1.270.0230.01014.45
7.1.260.0180.00314.38
7.1.250.0210.00714.61
7.1.240.0140.00314.16
7.1.230.0160.01214.29
7.1.220.0150.00314.36
7.1.210.0070.01714.30
7.1.200.0070.00714.42
7.1.190.0600.00713.79
7.1.180.0110.00613.98
7.1.170.0160.00313.90
7.1.160.0050.01113.91
7.1.150.0160.00314.22
7.1.140.0140.00414.16
7.1.130.0140.00314.16
7.1.120.0120.00814.21
7.1.110.0180.00314.22
7.1.100.0210.00914.28
7.1.90.0260.01114.39
7.1.80.0310.00314.59
7.1.70.0170.01014.41
7.1.60.0120.01314.24
7.1.50.0150.00614.46
7.1.40.0080.01114.39
7.1.30.0200.01814.60
7.1.20.0210.00514.58
7.1.10.0190.00714.52
7.1.00.0270.00914.25
7.0.330.0220.00313.80
7.0.320.0100.01414.16
7.0.310.0190.00714.20
7.0.300.0130.00413.93
7.0.290.0250.00614.13
7.0.280.0250.00514.02
7.0.270.0080.01114.07
7.0.260.0580.00713.80
7.0.250.0170.00313.82
7.0.240.0040.01414.09
7.0.230.0310.00714.22
7.0.220.0170.00314.02
7.0.210.0210.00614.16
7.0.200.0100.01014.23
7.0.190.0080.01214.02
7.0.180.0230.00013.93
7.0.170.0120.00914.21
7.0.160.1020.01013.93
7.0.150.0120.01814.13
7.0.140.0200.01114.11
7.0.130.0080.00814.06
7.0.120.0100.01014.26
7.0.110.0160.00814.04
7.0.100.0210.01613.98
7.0.90.0110.00814.18
7.0.80.0100.01014.24
7.0.70.0120.00413.82
7.0.60.0150.00913.92
7.0.50.0120.01214.21
7.0.40.0100.01013.99
7.0.30.0080.01213.81
7.0.20.0080.02414.29
7.0.10.0140.00314.01
7.0.00.0120.00214.18
5.6.400.0060.00914.73
5.6.390.0120.00615.02
5.6.380.0060.01514.35
5.6.370.0100.01114.83
5.6.360.0100.01014.94
5.6.350.0140.00514.77
5.6.340.0150.00915.09
5.6.330.0120.00615.09
5.6.320.0220.00614.88
5.6.310.0090.00914.93
5.6.300.0200.00315.07
5.6.290.0170.00714.91
5.6.280.0080.00815.09
5.6.270.0100.00714.89
5.6.260.0110.01314.54
5.6.250.0080.01214.98
5.6.240.0070.01414.82
5.6.230.0160.00615.16
5.6.220.0130.00315.10
5.6.210.0140.00715.00
5.6.200.0220.00515.04
5.6.190.0130.00715.02
5.6.180.0190.00314.83
5.6.170.0110.01114.82
5.6.160.0170.00814.75
5.6.150.0140.00714.75
5.6.140.0160.00415.15
5.6.130.0140.00715.02
5.6.120.0150.00614.99
5.6.110.0130.00515.08
5.6.100.0150.00714.88
5.6.90.0130.00315.05
5.6.80.0130.00814.68
5.6.70.0110.00614.97
5.6.60.0150.00314.91
5.6.50.0230.00814.66
5.6.40.0150.00914.86
5.6.30.0100.02014.77
5.6.20.0170.00714.57
5.6.10.0080.01714.79
5.6.00.0110.01414.78
5.5.380.0120.00913.82
5.5.370.0150.00914.17
5.5.360.0180.00714.21
5.5.350.0170.01113.88
5.5.340.0120.00914.05
5.5.330.0190.00014.13
5.5.320.0150.00614.22
5.5.310.0080.01613.88
5.5.300.0180.00313.66
5.5.290.0160.00914.16
5.5.280.0170.00313.88
5.5.270.0180.00613.97
5.5.260.0090.01614.10
5.5.250.0160.00814.01
5.5.240.0090.00614.05
5.5.230.0180.00613.81
5.5.220.0130.00713.75
5.5.210.0150.00513.82
5.5.200.0160.00313.95
5.5.190.0160.01213.53
5.5.180.0180.01413.96
5.5.170.0130.00913.85
5.5.160.0130.01614.05
5.5.150.0180.00514.05
5.5.140.0100.00713.83
5.5.130.0100.00914.10
5.5.120.0070.01113.80
5.5.110.0230.00813.92
5.5.100.0190.01213.82
5.5.90.0100.01913.81
5.5.80.0140.00513.80
5.5.70.0170.00013.74
5.5.60.0060.01213.71
5.5.50.0080.00813.96
5.5.40.0110.01113.87
5.5.30.0160.01613.79
5.5.20.0150.00913.79
5.5.10.0150.01213.46
5.5.00.0150.01613.98
5.4.450.0110.00311.26
5.4.440.0080.00511.26
5.4.430.0150.00511.26
5.4.420.0130.00011.26
5.4.410.0060.00611.26
5.4.400.0080.00411.26
5.4.390.0150.00711.26
5.4.380.0140.00711.26
5.4.370.0100.01011.26
5.4.360.0130.01011.26
5.4.350.0060.01311.26
5.4.340.0110.00011.26
5.4.330.0100.00311.26
5.4.320.0120.00311.26
5.4.310.0070.00511.26
5.4.300.0110.00711.26
5.4.290.0000.01311.26
5.4.280.0080.00511.26
5.4.270.0100.00611.26
5.4.260.0130.00311.26
5.4.250.0030.00911.26
5.4.240.0060.00611.26
5.4.230.0000.01011.26
5.4.220.0100.00211.26
5.4.210.0220.00011.26
5.4.200.0050.01011.26
5.4.190.0120.00911.26
5.4.180.0120.00611.26
5.4.170.0090.00811.26
5.4.160.0120.00311.26
5.4.150.0130.01011.26
5.4.140.0200.00311.26
5.4.130.0150.00711.26
5.4.120.0090.00511.26
5.4.110.0070.00511.26
5.4.100.0100.00711.26
5.4.90.0110.00611.26
5.4.80.0130.00011.26
5.4.70.0060.00611.26
5.4.60.0090.00311.26
5.4.50.0150.00011.26
5.4.40.0040.00711.26
5.4.30.0030.00611.26
5.4.20.0140.00411.26
5.4.10.0100.00411.26
5.4.00.0080.00311.26
5.3.290.0110.01111.26
5.3.280.0130.00011.26
5.3.270.0150.00311.26
5.3.260.0050.01111.26
5.3.250.0150.00611.26
5.3.240.0120.00611.26
5.3.230.0110.01111.26
5.3.220.0130.00011.26
5.3.210.0100.00211.26
5.3.200.0130.00511.26
5.3.190.0060.00611.26
5.3.180.0050.00611.26
5.3.170.0130.00411.26
5.3.160.0130.00311.26
5.3.150.0120.00011.26
5.3.140.0130.00011.26
5.3.130.0110.01111.26
5.3.120.0100.00011.26
5.3.110.0000.00911.26
5.3.100.0080.00411.26
5.3.90.0050.00511.26
5.3.80.0030.00611.26
5.3.70.0080.00411.26
5.3.60.0110.00611.26
5.3.50.0100.00011.26
5.3.40.0060.00611.26
5.3.30.0040.00811.26
5.3.20.0080.00411.26
5.3.10.0000.01111.26
5.3.00.0090.00211.26
5.2.170.0110.00011.26
5.2.160.0060.00311.26
5.2.150.0030.00611.26
5.2.140.0100.00011.26
5.2.130.0090.00011.26
5.2.120.0090.00011.26
5.2.110.0080.00811.26
5.2.100.0100.00011.26
5.2.90.0030.00611.26
5.2.80.0100.00411.26
5.2.70.0080.00411.26
5.2.60.0030.00611.26
5.2.50.0110.00311.26
5.2.40.0060.00911.26
5.2.30.0100.00511.26
5.2.20.0110.00711.26
5.2.10.0070.00411.26
5.2.00.0060.00611.26
5.1.60.0030.00711.26
5.1.50.0070.00711.26
5.1.40.0080.00411.26
5.1.30.0070.00211.26
5.1.20.0090.00311.26
5.1.10.0070.00011.26
5.1.00.0110.00411.26
5.0.50.0100.00011.26
5.0.40.0000.00711.26
5.0.30.0040.00311.26
5.0.20.0050.00511.26
5.0.10.0030.00311.26
5.0.00.0030.00611.26
4.4.90.0040.00411.26
4.4.80.0060.00211.26
4.4.70.0070.00311.26
4.4.60.0030.00311.26
4.4.50.0020.00211.26
4.4.40.0060.00311.26
4.4.30.0060.00311.26
4.4.20.0060.00011.26
4.4.10.0090.00011.26
4.4.00.0030.00311.26
4.3.110.0050.00011.26
4.3.100.0000.00611.26
4.3.90.0050.00511.26
4.3.80.0050.00511.26
4.3.70.0040.00211.26
4.3.60.0000.00911.26
4.3.50.0110.00011.26
4.3.40.0090.00011.26
4.3.30.0000.00711.26
4.3.20.0030.00611.26
4.3.10.0000.00711.26
4.3.00.0000.00511.26

preferences:
65.54 ms | 403 KiB | 5 Q