3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { private $pdo; private static $instance; private function __construct() { $this->pdo = new PDO(/* params here */); } public static function getInstance() { if (null === self::$instance) { $self::instance = new self(); } return self::$Instance; } /** * Just an example method to show * how to interact with the PDO instance */ public function queryAndFetch($query) { $stmt = $this->pdo->query($query); return $stmt->fetchAll(PDO::FETCH_ASSOC); } }

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)
5.4.300.0050.04012.52
5.4.290.0060.03812.52
5.4.280.0060.03612.41
5.4.270.0090.03412.41
5.4.260.0080.03612.41
5.4.250.0060.04012.41
5.4.240.0100.03412.41
5.4.230.0050.04012.40
5.4.220.0050.03812.41
5.4.210.0100.04712.41
5.4.200.0090.05212.40
5.4.190.0100.05012.40
5.4.180.0120.04712.40
5.4.170.0070.05312.41
5.4.160.0070.04912.40
5.4.150.0080.04912.40
5.4.140.0080.05012.09
5.4.130.0080.03612.07
5.4.120.0050.03712.04
5.4.110.0050.03612.04
5.4.100.0050.03712.04
5.4.90.0080.03612.03
5.4.80.0060.03912.04
5.4.70.0050.04412.03
5.4.60.0090.04312.03
5.4.50.0100.04712.03
5.4.40.0080.04812.02
5.4.30.0080.04112.02
5.4.20.0080.03512.01
5.4.10.0030.03912.02
5.4.00.0060.03811.51
5.3.280.0050.03912.70
5.3.270.0050.04112.72
5.3.260.0050.04312.72
5.3.250.0100.03412.72
5.3.240.0070.04012.72
5.3.230.0090.04012.71
5.3.220.0090.03612.68
5.3.210.0100.03712.68
5.3.200.0090.04512.68
5.3.190.0110.04812.68
5.3.180.0090.04812.68
5.3.170.0120.04612.67
5.3.160.0090.04612.67
5.3.150.0080.03712.67
5.3.140.0110.03212.66
5.3.130.0080.03812.66
5.3.120.0090.03712.66
5.3.110.0080.03712.66
5.3.100.0100.03412.13
5.3.90.0120.03112.11
5.3.80.0070.03612.10
5.3.70.0060.03712.10
5.3.60.0060.03712.09
5.3.50.0040.03812.03
5.3.40.0060.03612.03
5.3.30.0070.03411.99
5.3.20.0030.03811.77
5.3.10.0060.03411.74
5.3.00.0050.03711.72

preferences:
137.29 ms | 1394 KiB | 7 Q