3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace SQLQuery; class SQLQuery { private static $methods = array('select', 'update', 'drop', 'delete', 'create', 'alter', 'set'); private static $char_list = array( 'default' => array( 'escape' => '\\', 'quotes' => '"', 'names' => '`', 'name_separator' => '.' ), 'mysqli' => array( 'escape' => '\\', 'quotes' => '"', 'names' => '`', 'name_separator' => '.' ), 'sqlite3' => array( 'escape' => '\\', 'quotes' => '"', 'names' => '`', 'name_separator' => '.' ) ); private $chars = array(); private $type = 'unknown'; private $link = null; function __call($method, $arguments){ if(!in_array($method, self::$methods)) { throw new BadMethodCallException('Method ' . $method . ' does not exist'); } $class = __CLASS__ . ucfirst($method); return new $class($this, $this->chars, $arguments); } function __construct($link = false){ if(is_resource($link)) { $type = get_resource_type($link); if($type !== 'mysql link' || $type !== 'mysql link persistent') { throw new InvalidArgumentException('MySQL resource expected, ' . $type . ' given'); } $this->link = $link; $this->type = 'mysql'; $this->chars = self::$char_list['default']; } else if(is_object($link)) { if(class_exists('PDO') && ($link instanceof \PDO)) { $type = $link->getAttribute(\PDO::ATTR_DRIVER_NAME); } else if(class_exists('mysqli') && ($link instanceof \mysqli)) { $type = 'mysqli'; } else if(class_exists('SQLite3') && ($link instanceof \SQLite3)) { $type = 'sqlite3'; } else { throw new InvalidArgumentException('Unsupported connection type ' . get_class($link)); } $this->link = $link; $this->type = $type; $this->chars = self::$char_list[$type]; } else throw new InvalidArgumentException('Resource or Object excepted, ' . gettype($link) . ' given'); } } if(!@class_alias('SQLQuery\\SQLQuery', '\\SQLQuery')) { // very ugly hack eval('class SQLQuery extends \SQLQuery\SQLQuery{};'); } final class SQLQuerySelect { function __construct(SQLQuery $sql, array $chars, $arguments){ var_dump($chars, $arguments); } } // --------------------------------- $x = new \SQLQuery(new \SQLite3()); $x->select('a');

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.0120.00916.63
8.3.50.0120.00618.32
8.3.40.0000.01518.66
8.3.30.0110.00418.66
8.3.20.0080.00020.34
8.3.10.0040.00422.22
8.3.00.0050.00323.70
8.2.180.0040.01818.16
8.2.170.0120.00622.96
8.2.160.0120.00320.35
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0090.00020.37
8.2.110.0030.00721.03
8.2.100.0040.00817.99
8.2.90.0080.00019.00
8.2.80.0040.00417.97
8.2.70.0040.00417.38
8.2.60.0000.00817.93
8.2.50.0040.00418.22
8.2.40.0000.00720.47
8.2.30.0080.00021.05
8.2.20.0040.00418.08
8.2.10.0040.00417.97
8.2.00.0000.00818.13
8.1.280.0080.00825.92
8.1.270.0000.00818.88
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0000.01022.81
8.1.230.0080.00320.31
8.1.220.0060.00617.74
8.1.210.0030.00518.77
8.1.200.0000.01217.35
8.1.190.0100.00017.00
8.1.180.0080.00018.10
8.1.170.0080.00018.65
8.1.160.0000.00718.80
8.1.150.0040.00420.10
8.1.140.0080.00019.48
8.1.130.0030.00317.42
8.1.120.0000.00717.50
8.1.110.0040.00417.48
8.1.100.0040.00417.45
8.1.90.0080.00017.43
8.1.80.0050.00317.45
8.1.70.0030.00517.39
8.1.60.0040.00417.63
8.1.50.0090.00017.48
8.1.40.0070.00317.41
8.1.30.0050.00317.63
8.1.20.0050.00317.51
8.1.10.0030.00517.41
8.1.00.0080.00017.45
8.0.300.0050.00319.09
8.0.290.0060.00316.75
8.0.280.0050.00318.41
8.0.270.0080.00017.21
8.0.260.0000.00816.91
8.0.250.0070.00316.95
8.0.240.0000.00717.02
8.0.230.0030.00316.94
8.0.220.0070.00016.99
8.0.210.0050.00316.98
8.0.200.0050.00317.05
8.0.190.0040.00416.95
8.0.180.0090.00017.04
8.0.170.0070.00016.91
8.0.160.0000.00716.99
8.0.150.0000.00717.02
8.0.140.0030.00616.95
8.0.130.0030.00613.41
8.0.120.0000.00817.00
8.0.110.0040.00416.88
8.0.100.0040.00417.04
8.0.90.0040.00417.02
8.0.80.0060.01016.98
8.0.70.0040.00416.98
8.0.60.0040.00416.90
8.0.50.0000.00716.79
8.0.30.0070.00917.06
8.0.20.0120.00717.40
8.0.10.0000.00916.95
8.0.00.0070.01016.77
7.4.330.0000.00615.55
7.4.320.0030.00316.61
7.4.300.0000.00616.53
7.4.290.0030.00316.48
7.4.280.0030.00616.32
7.4.270.0070.00016.47
7.4.260.0030.00316.48
7.4.250.0030.00416.42
7.4.240.0040.00416.55
7.4.230.0030.00316.47
7.4.220.0160.00316.44
7.4.210.0030.01316.60
7.4.200.0070.00016.41
7.4.160.0070.00916.52
7.4.150.0110.01017.40
7.4.140.0100.01117.86
7.4.130.0110.00716.61
7.4.120.0100.01116.55
7.4.110.0070.01016.49
7.4.100.0140.01116.52
7.4.90.0030.01416.60
7.4.80.0140.00519.39
7.4.70.0000.01816.52
7.4.60.0100.00916.49
7.4.50.0030.00716.59
7.4.40.0140.00416.43
7.4.30.0130.00316.51
7.4.00.0060.01015.02
7.3.330.0050.00013.22
7.3.320.0060.00013.13
7.3.310.0040.00416.45
7.3.300.0000.00716.34
7.3.290.0050.01216.39
7.3.280.0070.00916.38
7.3.270.0090.00917.40
7.3.260.0100.01016.60
7.3.250.0070.01116.47
7.3.240.0070.01316.49
7.3.230.0100.00716.50
7.3.210.0060.01016.47
7.3.200.0170.00016.35
7.3.190.0110.01116.54
7.3.180.0090.00916.35
7.3.170.0030.01316.41
7.3.160.0090.00616.54
7.2.330.0060.01116.50
7.2.320.0120.01116.58
7.2.310.0060.01316.71
7.2.300.0090.00916.63
7.2.290.0140.00316.48
7.2.60.0030.01316.73
7.1.200.0060.00915.54
7.1.90.0000.01217.69
7.1.80.0050.00817.93
7.1.70.0030.01216.80
7.1.60.0210.00734.81
7.1.50.0100.01434.85
7.1.40.0100.01634.36
7.1.30.0160.00934.29
7.1.20.0170.01034.37
7.1.10.0060.00616.24
7.1.00.0040.00816.48
7.0.230.0080.00417.40
7.0.220.0030.01017.45
7.0.210.0060.00616.85
7.0.200.0000.01216.69
7.0.190.0070.00316.56
7.0.180.0000.01116.37
7.0.170.0060.00616.31
7.0.160.0060.00616.20
7.0.150.0060.00615.96
7.0.140.0040.00816.33
7.0.130.0090.00316.59
7.0.120.0000.01116.54
7.0.110.0000.01116.31
7.0.100.0040.00816.34
7.0.90.0000.01216.25
7.0.80.0000.01116.31
7.0.70.0040.00716.18
7.0.60.0060.00616.02
7.0.50.0030.01016.24
7.0.40.0030.01016.68
7.0.30.0060.00816.52
7.0.20.0060.00616.31
7.0.10.0060.00616.30
7.0.00.0030.00916.36

preferences:
59.35 ms | 400 KiB | 5 Q