3v4l.org

run code in 300+ PHP versions simultaneously
<?php //simulatiing a similar situation class PDO2{} class DB{ public static function connection(){ //I know it's not something like this, but that isn't what we're concerned here return new class { public function getPdo(){ return new PDO2(); } }; } }; class Test { protected $pdo; public function __construct(PDO2 $pdo) { $this->pdo = $pdo; } } var_dump(new Test($pdo = DB::connection()->getPdo()));

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.0090.00616.50
8.3.50.0070.00718.18
8.3.40.0110.00418.84
8.3.30.0110.01118.45
8.3.20.0080.00020.98
8.3.10.0080.00021.66
8.3.00.0080.00017.63
8.2.180.0090.00916.50
8.2.170.0100.00722.96
8.2.160.0170.00321.02
8.2.150.0030.00524.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00021.06
8.2.110.0090.00021.18
8.2.100.0120.00017.78
8.2.90.0070.00020.60
8.2.80.0000.00817.97
8.2.70.0040.00417.50
8.2.60.0040.00417.75
8.2.50.0090.00017.80
8.2.40.0050.00319.66
8.2.30.0000.00719.11
8.2.20.0050.00218.06
8.2.10.0030.00519.34
8.2.00.0080.00017.92
8.1.280.0110.00425.92
8.1.270.0050.00323.96
8.1.260.0090.00026.35
8.1.250.0000.00728.09
8.1.240.0100.00717.71
8.1.230.0080.00421.03
8.1.220.0000.00817.78
8.1.210.0000.00818.88
8.1.200.0060.00317.36
8.1.190.0000.00817.35
8.1.180.0030.00518.10
8.1.170.0040.00417.62
8.1.160.0040.00418.95
8.1.150.0040.00418.76
8.1.140.0030.00318.79
8.1.130.0040.00417.34
8.1.120.0030.00517.35
8.1.110.0090.00017.37
8.1.100.0040.00417.40
8.1.90.0000.00817.44
8.1.80.0030.00617.35
8.1.70.0040.00417.44
8.1.60.0060.00317.47
8.1.50.0040.00417.39
8.1.40.0030.00617.48
8.1.30.0030.00617.48
8.1.20.0000.00917.56
8.1.10.0040.00417.50
8.1.00.0000.00717.36
8.0.300.0000.00719.98
8.0.290.0000.00816.63
8.0.280.0030.00318.44
8.0.270.0070.00017.16
8.0.260.0030.00316.88
8.0.250.0090.00017.04
8.0.240.0000.01016.99
8.0.230.0000.00716.92
8.0.220.0070.00016.88
8.0.210.0040.00416.84
8.0.200.0060.00016.90
8.0.190.0050.00317.07
8.0.180.0050.00316.86
8.0.170.0000.00917.03
8.0.160.0040.00416.85
8.0.150.0040.00416.89
8.0.140.0040.00416.93
8.0.130.0030.00313.41
8.0.120.0060.00316.88
8.0.110.0030.00516.82
8.0.100.0000.00716.95
8.0.90.0020.00517.01
8.0.80.0110.00516.88
8.0.70.0070.00017.01
8.0.60.0000.00716.99
8.0.50.0040.00416.93
8.0.30.0120.00717.10
8.0.20.0030.01417.22
8.0.10.0070.00017.02
8.0.00.0100.01016.78
7.4.330.0000.00515.55
7.4.320.0030.00316.48
7.4.300.0030.00316.59
7.4.290.0000.00716.59
7.4.280.0060.00316.54
7.4.270.0030.00316.57
7.4.260.0040.00416.48
7.4.250.0000.00716.57
7.4.240.0030.00316.49
7.4.230.0030.00316.62
7.4.220.0050.00316.43
7.4.210.0060.01016.57
7.4.200.0030.00316.70
7.4.160.0090.00816.59
7.4.140.0110.00717.86
7.4.130.0130.01016.45
7.4.120.0180.00316.56
7.4.110.0070.01316.50
7.4.100.0160.00716.60
7.4.90.0150.00416.55
7.4.80.0120.01219.39
7.4.70.0060.01316.70
7.4.60.0150.00016.44
7.4.50.0070.01016.27
7.4.40.0070.01416.43
7.4.00.0000.01715.05
7.3.330.0020.00213.01
7.3.320.0000.00613.05
7.3.310.0030.00316.23
7.3.300.0000.00616.18
7.3.290.0070.00016.24
7.3.280.0090.00616.20
7.3.260.0110.00716.33
7.3.240.0110.00916.46
7.3.230.0100.00616.30
7.3.210.0030.01516.21
7.3.200.0070.01116.24
7.3.190.0130.00316.27
7.3.180.0110.00416.51
7.3.170.0120.00616.23
7.3.160.0030.01216.18
7.3.10.0330.00814.70
7.3.00.0390.01014.70
7.2.330.0120.00616.53
7.2.320.0030.01316.84
7.2.310.0060.01016.53
7.2.300.0100.00616.63
7.2.290.0140.01216.61
7.2.130.0380.01015.09
7.2.120.0310.00615.15
7.2.110.0330.00615.20
7.2.100.0360.00415.21
7.2.90.0380.00715.04
7.2.80.0400.00014.89
7.2.70.0250.00314.83
7.2.60.0030.00815.04
7.2.50.0320.00314.84
7.2.40.0390.00715.08
7.2.30.0450.00314.85
7.2.20.0380.00915.11
7.2.10.0410.00015.01
7.2.00.0350.00614.93
7.1.250.0480.00013.62

preferences:
66.1 ms | 400 KiB | 5 Q