3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Database { protected static $instance; protected $pdo; 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->query($sql); } if ($stmt = $this->prepare($sql)) { if ($stmt->execute($args)) { return $stmt; } } return false; } 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(); var_dump($db->run('SELECT ?', ['foo', 'bar'])); //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.0130.00619.22
8.3.120.0080.00021.40
8.3.110.0060.00320.94
8.3.100.0060.00319.50
8.3.90.0000.00819.32
8.3.80.0090.00017.63
8.3.70.0040.01117.24
8.3.60.0140.00019.31
8.3.50.0130.00317.32
8.3.40.0100.00619.70
8.3.30.0040.01119.69
8.3.20.0030.00721.78
8.3.10.0000.00822.45
8.3.00.0080.00024.43
8.2.250.0150.00419.45
8.2.240.0150.00318.24
8.2.230.0160.00322.58
8.2.220.0000.00924.06
8.2.210.0030.00526.77
8.2.200.0110.00017.38
8.2.190.0120.00617.38
8.2.180.0040.01519.30
8.2.170.0040.01122.96
8.2.160.0070.00721.14
8.2.150.0030.00624.18
8.2.140.0000.00724.66
8.2.130.0080.00026.16
8.2.120.0040.00420.57
8.2.110.0030.00621.13
8.2.100.0070.00718.78
8.2.90.0080.00318.50
8.2.80.0080.00018.68
8.2.70.0050.00318.38
8.2.60.0050.00318.50
8.2.50.0040.00418.68
8.2.40.0030.00620.23
8.2.30.0050.00320.08
8.2.20.0030.00618.73
8.2.10.0000.00819.70
8.2.00.0000.00720.27
8.1.300.0060.00319.31
8.1.290.0030.00620.53
8.1.280.0100.00725.92
8.1.270.0030.00624.55
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0090.00023.23
8.1.230.0090.00319.97
8.1.220.0040.00418.40
8.1.210.0040.00418.77
8.1.200.0090.00018.13
8.1.190.0050.00518.10
8.1.180.0030.00518.11
8.1.170.0000.00818.11
8.1.160.0000.00819.59
8.1.150.0020.00519.71
8.1.140.0000.00719.57
8.1.130.0030.00320.86
8.1.120.0040.00418.27
8.1.110.0040.00418.23
8.1.100.0000.00818.23
8.1.90.0030.00618.20
8.1.80.0000.00818.27
8.1.70.0040.00418.18
8.1.60.0060.00318.46
8.1.50.0080.00018.33
8.1.40.0030.00618.25
8.1.30.0040.00418.31
8.1.20.0000.00818.38
8.1.10.0050.00318.44
8.1.00.0040.00418.36
8.0.300.0000.00720.32
8.0.290.0060.00317.63
8.0.280.0070.00019.26
8.0.270.0000.00718.05
8.0.260.0000.00721.04
8.0.250.0030.00317.86
8.0.240.0050.00317.73
8.0.230.0040.00417.87
8.0.220.0000.00717.66
8.0.210.0030.00417.80
8.0.200.0000.00717.82
8.0.190.0040.00417.64
8.0.180.0000.00817.71
8.0.170.0060.00317.64
8.0.160.0050.00317.71
8.0.150.0060.00317.66
8.0.140.0000.00717.62
8.0.130.0030.00314.11
8.0.120.0040.00417.59
8.0.110.0070.00017.73
8.0.100.0030.00517.65
8.0.90.0070.00017.70
8.0.80.0090.00617.71
8.0.70.0000.00717.75
8.0.60.0050.00317.58
8.0.50.0080.00017.56
8.0.30.0140.00717.67
8.0.20.0170.00918.25
8.0.10.0040.00417.91
8.0.00.0110.01017.55
7.4.330.0030.00315.83
7.4.320.0060.00017.32
7.4.300.0000.00717.31
7.4.290.0020.00517.39
7.4.280.0000.00817.20
7.4.270.0030.00317.41
7.4.260.0050.00217.17
7.4.250.0000.00817.29
7.4.240.0020.00517.23
7.4.230.0050.00317.10
7.4.220.0090.00017.45
7.4.210.0100.00717.27
7.4.200.0050.00317.36
7.4.160.0100.00817.27
7.4.130.0120.00617.44
7.4.120.0140.00317.17
7.4.110.0090.00917.28
7.4.100.0090.01717.27
7.4.90.0070.01017.28
7.4.80.0110.00719.39
7.4.70.0140.00717.25
7.4.60.0060.01617.12
7.4.50.0070.00717.05
7.4.40.0070.01017.29
7.4.10.0130.00615.73
7.4.00.0070.01115.63
7.3.330.0060.00014.13
7.3.320.0060.00013.90
7.3.310.0030.00317.09
7.3.300.0040.00217.03
7.3.290.0030.00317.14
7.3.280.0090.01017.07
7.3.260.0090.01117.29
7.3.240.0100.00917.32
7.3.230.0120.00617.11
7.3.210.0130.00717.31
7.3.200.0070.01717.03
7.3.190.0070.01017.11
7.3.180.0130.00317.30
7.3.170.0060.01217.27
7.3.160.0060.01517.19
7.3.130.0040.01815.51
7.3.120.0070.01115.61
7.3.110.0040.01515.41
7.3.100.0080.00515.37
7.3.90.0030.01315.38
7.3.80.0040.00815.62
7.3.70.0070.00715.70
7.3.60.0060.01315.64
7.3.50.0100.00915.45
7.3.40.0080.00715.46
7.3.30.0070.00915.35
7.3.20.0020.01316.43
7.3.10.0140.00716.43
7.3.00.0120.00516.57
7.2.330.0060.01217.30
7.2.320.0030.01417.27
7.2.310.0130.00317.46
7.2.300.0090.00817.23
7.2.290.0090.00917.44
7.2.260.0120.00815.90
7.2.250.0150.00815.80
7.2.240.0060.01115.87
7.2.230.0030.01315.88
7.2.220.0000.01215.82
7.2.210.0070.00715.82
7.2.200.0090.00915.66
7.2.190.0060.00815.85
7.2.180.0060.00915.51
7.2.170.0040.01615.58
7.2.160.0060.01015.77
7.2.150.0090.01416.69
7.2.140.0180.00516.77
7.2.130.0110.00916.63
7.2.120.0190.00416.53
7.2.110.0140.00416.55
7.2.100.0100.00816.65
7.2.90.0080.01216.77
7.2.80.0130.00616.82
7.2.70.0100.00716.55
7.2.60.0110.01416.63
7.2.50.0110.00816.72
7.2.40.0160.00516.71
7.2.30.0090.00916.66
7.2.20.0080.01016.67
7.2.10.0220.00516.62
7.2.00.0070.01216.68
7.1.330.0080.00816.52
7.1.320.0090.00316.56
7.1.310.0070.00716.55
7.1.300.0030.00616.16
7.1.290.0060.00616.49
7.1.280.0280.00915.30
7.1.270.0110.00915.40
7.1.260.0110.01115.55
7.1.250.0090.00515.56
7.1.240.0070.01215.33
7.1.230.0140.00415.16
7.1.220.0110.00615.14
7.1.210.0160.00515.44
7.1.200.0090.01015.30
7.1.190.0170.00415.36
7.1.180.0100.00715.19
7.1.170.0130.00715.43
7.1.160.0060.00815.13
7.1.150.0080.01315.14
7.1.140.0100.01015.29
7.1.130.0080.00915.18
7.1.120.0080.00915.34
7.1.110.0040.01015.27
7.1.100.0090.01015.25
7.1.90.0070.01215.44
7.1.80.0130.00315.29
7.1.70.0120.00315.40
7.1.60.0080.01115.28
7.1.50.0080.01015.18
7.1.40.0110.00315.56
7.1.30.0120.00915.27
7.1.20.0140.00515.17
7.1.10.0160.00815.17
7.1.00.0140.00715.46
7.0.330.0150.00614.03
7.0.320.0130.01314.29
7.0.310.0200.01014.32
7.0.300.0160.00413.95
7.0.290.0210.00314.15
7.0.280.0170.00614.31
7.0.270.0170.00814.13
7.0.260.0170.00414.37
7.0.250.0210.00014.20
7.0.240.0180.01114.32
7.0.230.0170.00014.29
7.0.220.0080.01214.34
7.0.210.0200.00814.17
7.0.200.0600.01214.37
7.0.190.0210.00814.22
7.0.180.0140.00714.06
7.0.170.0130.00714.43
7.0.160.0170.00514.41
7.0.150.0290.00614.33
7.0.140.0160.01114.35
7.0.130.0160.00814.03
7.0.120.0130.01314.25
7.0.110.0150.00614.19
7.0.100.0170.00314.35
7.0.90.0210.01114.13
7.0.80.0220.00714.29
7.0.70.0120.00913.93
7.0.60.0250.00714.06
7.0.50.0080.01614.34
7.0.40.0240.00314.01
7.0.30.0070.02114.19
7.0.20.0210.01714.37
7.0.10.0220.01014.41
7.0.00.0540.00314.38
5.6.400.0050.01914.81
5.6.390.0040.02014.52
5.6.380.0070.00914.59
5.6.370.0110.00915.05
5.6.360.0160.00814.78
5.6.350.0210.00815.05
5.6.340.0150.01515.17
5.6.330.0130.01314.93
5.6.320.0180.00814.84
5.6.310.0140.01714.97
5.6.300.0200.00614.98
5.6.290.0170.01114.74
5.6.280.0220.00615.28
5.6.270.0150.00314.92
5.6.260.0190.01115.04
5.6.250.0160.00815.04
5.6.240.0140.01414.84
5.6.230.0240.00815.03
5.6.220.0130.01614.88
5.6.210.0200.01214.76
5.6.200.0120.00615.19
5.6.190.0130.00915.20
5.6.180.0090.01715.21
5.6.170.0130.00414.91
5.6.160.0170.00514.91
5.6.150.0000.01814.63
5.6.140.0110.01114.96
5.6.130.0070.01114.66
5.6.120.0170.00714.75
5.6.110.0180.00014.82
5.6.100.0080.01114.93
5.6.90.0110.00815.10
5.6.80.0100.01614.89
5.6.70.0180.00014.54
5.6.60.0150.00614.94
5.6.50.0170.00715.04
5.6.40.0260.00414.80
5.6.30.0140.01414.79
5.6.20.0140.00714.56
5.6.10.0170.01314.87
5.6.00.0120.01814.89
5.5.380.0110.00814.30
5.5.370.0170.01014.00
5.5.360.0230.00314.05
5.5.350.0120.00613.70
5.5.340.0120.00613.89
5.5.330.0210.00614.22
5.5.320.0220.00714.01
5.5.310.0100.00714.37
5.5.300.0090.01214.43
5.5.290.0120.00914.14
5.5.280.0100.00414.17
5.5.270.0110.00714.09
5.5.260.0090.01013.66
5.5.250.0200.00814.06
5.5.240.0150.00913.91
5.5.230.0110.00713.95
5.5.220.0170.00814.05
5.5.210.0220.00013.73
5.5.200.0200.00013.80
5.5.190.0150.00913.77
5.5.180.0160.00614.10
5.5.170.0090.00914.13
5.5.160.0120.00513.64
5.5.150.0210.00414.02
5.5.140.0220.00613.98
5.5.130.0170.00414.19
5.5.120.0260.00013.79
5.5.110.0120.01614.11
5.5.100.0190.00714.08
5.5.90.0160.00314.11
5.5.80.0120.01613.76
5.5.70.0140.00914.26
5.5.60.0170.00613.83
5.5.50.0170.00013.89
5.5.40.0110.01114.06
5.5.30.0240.00613.85
5.5.20.0140.00613.80
5.5.10.0150.00314.18
5.5.00.0060.01314.01
5.4.450.0060.01411.26
5.4.440.0120.00011.26
5.4.430.0100.00711.26
5.4.420.0070.00711.26
5.4.410.0070.01011.26
5.4.400.0050.00811.26
5.4.390.0100.00711.26
5.4.380.0120.00411.26
5.4.370.0080.00911.26
5.4.360.0070.00311.26
5.4.350.0130.00211.26
5.4.340.0090.00411.26
5.4.330.0080.00411.26
5.4.320.0120.00811.26
5.4.310.0170.00311.26
5.4.300.0110.00711.26
5.4.290.0180.00511.26
5.4.280.0130.01311.26
5.4.270.0050.01411.26
5.4.260.0120.00611.26
5.4.250.0150.00811.26
5.4.240.0110.00811.26
5.4.230.0090.00611.26
5.4.220.0040.00911.26
5.4.210.0110.00611.26
5.4.200.0110.00011.26
5.4.190.0050.00911.26
5.4.180.0110.00311.26
5.4.170.0080.00811.26
5.4.160.0100.01011.26
5.4.150.0110.01111.26
5.4.140.0070.01011.26
5.4.130.0050.00511.26
5.4.120.0030.01311.26
5.4.110.0150.00411.26
5.4.100.0190.00311.26
5.4.90.0090.00311.26
5.4.80.0140.00011.26
5.4.70.0070.00611.26
5.4.60.0100.00811.26
5.4.50.0060.01011.26
5.4.40.0030.01011.26
5.4.30.0030.01011.26
5.4.20.0080.00511.26
5.4.10.0100.00611.26
5.4.00.0130.00811.26
5.3.290.0100.00711.26
5.3.280.0110.01111.26
5.3.270.0130.00011.26
5.3.260.0180.00511.26
5.3.250.0050.01511.26
5.3.240.0100.00311.26
5.3.230.0070.00711.26
5.3.220.0150.00411.26
5.3.210.0030.01011.26
5.3.200.0060.00511.26
5.3.190.0060.00611.26
5.3.180.0130.00011.26
5.3.170.0110.00611.26
5.3.160.0060.00611.26
5.3.150.0120.00011.26
5.3.140.0030.01011.26
5.3.130.0090.00311.26
5.3.120.0130.00011.26
5.3.110.0150.00011.26
5.3.100.0120.00611.26
5.3.90.0030.00911.26
5.3.80.0100.00411.26
5.3.70.0100.00311.26
5.3.60.0040.00811.26
5.3.50.0070.01111.26
5.3.40.0030.00811.26
5.3.30.0080.00311.26
5.3.20.0040.00711.26
5.3.10.0090.00311.26
5.3.00.0070.00311.26
5.2.170.0100.00311.26
5.2.160.0070.00711.26
5.2.150.0070.00411.26
5.2.140.0100.00011.26
5.2.130.0130.00011.26
5.2.120.0090.00011.26
5.2.110.0110.00011.26
5.2.100.0050.00511.26
5.2.90.0000.00811.26
5.2.80.0050.00511.26
5.2.70.0070.00311.26
5.2.60.0050.00511.26
5.2.50.0110.00011.26
5.2.40.0060.00311.26
5.2.30.0070.00311.26
5.2.20.0070.00211.26
5.2.10.0050.00511.26
5.2.00.0110.00311.26
5.1.60.0140.00011.26
5.1.50.0100.00011.26
5.1.40.0080.00411.26
5.1.30.0080.00811.26
5.1.20.0000.00711.26
5.1.10.0080.00311.26
5.1.00.0080.00411.26
5.0.50.0080.00311.26
5.0.40.0050.00511.26
5.0.30.0050.00511.26
5.0.20.0080.00411.26
5.0.10.0080.00411.26
5.0.00.0080.00611.26
4.4.90.0060.00011.26
4.4.80.0000.00611.26
4.4.70.0050.00011.26
4.4.60.0050.00011.26
4.4.50.0060.00011.26
4.4.40.0040.00511.26
4.4.30.0060.00311.26
4.4.20.0060.00311.26
4.4.10.0040.00011.26
4.4.00.0130.00011.26
4.3.110.0000.01111.26
4.3.100.0050.00511.26
4.3.90.0050.00511.26
4.3.80.0070.00511.26
4.3.70.0050.00511.26
4.3.60.0060.00611.26
4.3.50.0040.00911.26
4.3.40.0030.00311.26
4.3.30.0000.00511.26
4.3.20.0030.00311.26
4.3.10.0060.00311.26
4.3.00.0050.00511.26

preferences:
30.75 ms | 403 KiB | 5 Q