3v4l.org

run code in 300+ PHP versions simultaneously
<?php // define the common interface interface StorageInterface { function store($key, $value); function retrieve($key); } // implement functionality common to descendants abstract class Storage implements StorageInterface { protected function normalizeKey($key) { return $normalizedKey; } protected function someOtherUtilityFunction() {} } // concrete implementations class S3 extends Storage { protected $backend; public function __construct(S3object $backend) { $this->backend = $backend; } public function store($key, $value) {} public function retrieve($key) {} } class DBX extends Storage { protected $backend; public function __construct(DBXobject $backend) { $this->backend = $backend; } public function store($key, $value) {} public function retrieve($key) {} } // maybe GCS is a completely different beast and can't/shouldn't descend from Storage class GoogleCloudStorage implements StorageInterface { protected $backend; public function __construct(GCSobject $backend) { $this->backend = $backend; } public function store($key, $value) {} public function retrieve($key) {} } // so long as the object implements the interface we don't care about its parentage class MyThingThatNeedsStorage { public function __construct(StorageInterface $storage) {} public function doSomething() { $this->storage->retrieve('foo'); } }

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.0100.01018.30
8.3.50.0070.00717.96
8.3.40.0070.00718.74
8.3.30.0040.01118.63
8.3.20.0040.00421.85
8.3.10.0000.00823.48
8.3.00.0000.00723.52
8.2.180.0110.00718.42
8.2.170.0120.00322.96
8.2.160.0080.01218.92
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00919.66
8.2.110.0030.00620.89
8.2.100.0090.00317.89
8.2.90.0040.00718.16
8.2.80.0000.00817.97
8.2.70.0040.00417.91
8.2.60.0030.00617.97
8.2.50.0000.00818.10
8.2.40.0040.00419.26
8.2.30.0050.00219.21
8.2.20.0000.00718.00
8.2.10.0000.00819.25
8.2.00.0040.00419.16
8.1.280.0150.00025.92
8.1.270.0040.00418.76
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00317.32
8.1.230.0040.00822.75
8.1.220.0050.00317.74
8.1.210.0060.00619.04
8.1.200.0000.01017.35
8.1.190.0080.00017.23
8.1.180.0030.00618.10
8.1.170.0040.00418.70
8.1.160.0000.00718.85
8.1.150.0030.00518.76
8.1.140.0080.00020.74
8.1.130.0030.00317.40
8.1.120.0030.00617.32
8.1.110.0000.00717.31
8.1.100.0070.00017.41
8.1.90.0090.00017.43
8.1.80.0030.00417.29
8.1.70.0030.00517.43
8.1.60.0000.00917.50
8.1.50.0020.00517.45
8.1.40.0030.00517.46
8.1.30.0080.00017.64
8.1.20.0000.00717.45
8.1.10.0080.00017.42
8.1.00.0030.00617.23
8.0.300.0070.00019.68
8.0.290.0030.00616.63
8.0.280.0000.00718.41
8.0.270.0000.00717.23
8.0.260.0030.00316.77
8.0.250.0000.00716.89
8.0.240.0030.00316.80
8.0.230.0040.00416.80
8.0.220.0000.00716.84
8.0.210.0070.00016.85
8.0.200.0030.00316.95
8.0.190.0040.00416.81
8.0.180.0000.00816.79
8.0.170.0000.00816.84
8.0.160.0030.00316.85
8.0.150.0050.00216.79
8.0.140.0040.00416.84
8.0.130.0000.00513.30
8.0.120.0040.00416.84
8.0.110.0070.00016.72
8.0.100.0040.00416.66
8.0.90.0070.00016.73
8.0.80.0060.01016.86
8.0.70.0070.00016.77
8.0.60.0000.00816.68
8.0.50.0070.00016.72
8.0.30.0110.00716.91
8.0.20.0130.00717.16
8.0.10.0080.00016.85
8.0.00.0090.00916.60
7.4.330.0050.00015.55
7.4.320.0070.00016.48
7.4.300.0060.00016.54
7.4.290.0000.00716.48
7.4.280.0040.00416.54
7.4.270.0030.00316.54
7.4.260.0000.00716.45
7.4.250.0040.00416.35
7.4.240.0030.00316.35
7.4.230.0040.00416.35
7.4.220.0050.00316.66
7.4.210.0090.00716.53
7.4.200.0040.00416.31
7.4.140.0090.00817.86
7.4.130.0140.00716.47
7.4.120.0130.00316.41
7.4.110.0030.01316.63
7.4.100.0100.00716.34
7.4.90.0060.01216.38
7.4.80.0080.01219.39
7.4.70.0120.00616.42
7.4.60.0110.01216.42
7.4.50.0090.00616.22
7.4.40.0090.01216.32
7.4.00.0040.00914.70
7.3.330.0060.00013.26
7.3.320.0030.00313.13
7.3.310.0060.00316.11
7.3.300.0030.00316.12
7.3.290.0030.00316.26
7.3.280.0110.00316.23
7.3.260.0080.00916.29
7.3.240.0120.00916.38
7.3.230.0070.01016.45
7.3.210.0110.00716.28
7.3.200.0090.00916.45
7.3.190.0070.01116.54
7.3.180.0100.00616.56
7.3.170.0050.01316.52
7.3.160.0090.01216.30
7.3.120.0160.00314.89
7.3.110.0070.01014.86
7.3.100.0090.00914.47
7.3.90.0050.00514.65
7.3.80.0100.00314.82
7.3.70.0100.00314.75
7.3.60.0040.01114.61
7.3.50.0000.00814.57
7.3.40.0140.00014.58
7.3.30.0000.01514.45
7.3.20.0030.00716.63
7.3.10.0290.00614.98
7.3.00.0410.01315.24
7.2.330.0100.00716.64
7.2.320.0090.00916.49
7.2.310.0100.00616.46
7.2.300.0070.01016.47
7.2.290.0000.01616.70
7.2.250.0030.01415.07
7.2.240.0070.01014.78
7.2.230.0040.01114.91
7.2.220.0060.00914.75
7.2.210.0100.00314.95
7.2.200.0100.00315.07
7.2.190.0110.00415.14
7.2.180.0060.00614.62
7.2.170.0110.00414.69
7.2.160.0090.00015.10
7.2.150.0040.00816.81
7.2.140.0070.00716.71
7.2.130.0340.00815.25
7.2.120.0310.00715.42
7.2.110.0480.00615.46
7.2.100.0360.00415.45
7.2.90.0300.00715.34
7.2.80.0350.00815.25
7.2.70.0360.00615.37
7.2.60.0490.01015.34
7.2.50.0310.00815.50
7.2.40.0330.00715.40
7.2.30.0300.00915.42
7.2.20.0310.00615.46
7.2.10.0260.00815.30
7.2.00.0240.00415.44
7.1.330.0000.01715.77
7.1.320.0030.01215.86
7.1.310.0060.01215.77
7.1.300.0100.00015.70
7.1.290.0080.00015.71
7.1.280.0060.00915.64
7.1.270.0030.00715.70
7.1.260.0030.01015.53
7.1.250.0380.00314.14
7.1.240.0030.01015.67
7.1.230.0050.00315.72
7.1.220.0070.00715.49
7.1.210.0000.01715.61
7.1.200.0030.00615.47
7.1.190.0000.01315.27
7.1.180.0100.00515.79
7.1.170.0040.01415.50
7.1.160.0050.00615.72
7.1.150.0080.00815.52
7.1.140.0110.00015.74
7.1.130.0100.00015.51
7.1.120.0070.00715.71
7.1.110.0070.00715.68
7.1.100.0040.00815.63
7.1.90.0070.00715.54
7.1.80.0000.01215.85
7.1.70.0030.00515.71
7.1.60.0040.00415.76
7.1.50.0000.00815.84
7.1.40.0130.00015.80
7.1.30.0040.01115.75
7.1.20.0080.00415.34
7.1.10.0040.00415.78
7.1.00.0030.01315.68

preferences:
58.49 ms | 400 KiB | 5 Q