3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Client { public function getUser(string $userId) { return [ 'id' => 5, ]; } } class Cache { public function set() { var_dump('Called set'); } public function get() { return null; } } class CachedClient { private $callee; private $cache; public function __construct($callee, $cache) { $this->callee = $callee; $this->cache = $cache; } public function __call(string $method, array $attributes) { $key = sprintf($method . '::' . implode(':', $attributes)); $result = $this->cache->get($key); if (!is_null($result)) { return $result; } $result = call_user_func_array([$this->client, $method], $attributes); $this->cache->set($key, $result); return $result; } } $client = new Client(); $cache = new Cache(); $cachedClient = new CachedClient($client, $cache); var_dump($cachedClient->getUser(5));

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.70.0150.00316.87
8.3.60.0160.00616.63
8.3.50.0090.00618.18
8.3.40.0000.01518.98
8.3.30.0150.00018.79
8.3.20.0070.00021.85
8.3.10.0040.00421.91
8.3.00.0040.00419.68
8.2.190.0130.00317.00
8.2.180.0180.00418.18
8.2.170.0160.00622.96
8.2.160.0130.00319.46
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00419.30
8.2.120.0080.00026.35
8.2.110.0040.00422.21
8.2.100.0090.00317.84
8.2.90.0000.00817.63
8.2.80.0050.00318.92
8.2.70.0000.00817.63
8.2.60.0040.00417.63
8.2.50.0040.00417.55
8.2.40.0050.00317.93
8.2.30.0040.00419.34
8.2.20.0000.00718.13
8.2.10.0040.00417.95
8.2.00.0000.00717.95
8.1.280.0100.00625.92
8.1.270.0070.00023.80
8.1.260.0060.00326.35
8.1.250.0050.00328.09
8.1.240.0000.01123.91
8.1.230.0000.01220.95
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0000.00817.48
8.1.190.0040.00419.01
8.1.180.0050.00318.10
8.1.170.0000.00817.62
8.1.160.0040.00418.96
8.1.150.0040.00419.03
8.1.140.0000.00817.73
8.1.130.0030.00318.96
8.1.120.0040.00317.39
8.1.110.0080.00017.48
8.1.100.0000.00817.52
8.1.90.0030.00617.51
8.1.80.0000.00717.39
8.1.70.0040.00717.52
8.1.60.0050.00317.47
8.1.50.0040.00817.57
8.1.40.0040.00417.41
8.1.30.0040.00417.66
8.1.20.0040.00417.64
8.1.10.0040.00417.50
8.1.00.0040.00417.55
8.0.300.0040.00418.77
8.0.290.0070.00016.88
8.0.280.0030.00318.53
8.0.270.0000.00717.29
8.0.260.0000.00617.32
8.0.250.0040.00416.97
8.0.240.0060.00317.07
8.0.230.0030.00316.94
8.0.220.0030.00316.88
8.0.210.0030.00516.89
8.0.200.0030.00317.04
8.0.190.0000.00817.03
8.0.180.0000.00816.92
8.0.170.0000.01116.92
8.0.160.0000.00716.95
8.0.150.0040.00417.04
8.0.140.0000.00716.98
8.0.130.0000.00813.40
8.0.120.0030.00616.86
8.0.110.0040.00416.82
8.0.100.0050.00316.96
8.0.90.0070.00017.06
8.0.80.0140.00717.05
8.0.70.0000.00716.85
8.0.60.0040.00416.88
8.0.50.0040.00416.92
8.0.30.0100.01017.17
8.0.20.0120.00817.40
8.0.10.0070.00017.18
8.0.00.0130.00816.99
7.4.330.0040.00415.55
7.4.320.0040.00416.43
7.4.300.0030.00316.54
7.4.290.0020.00516.65
7.4.280.0040.00416.52
7.4.270.0000.00716.42
7.4.260.0040.00416.64
7.4.250.0000.00716.52
7.4.240.0050.00316.51
7.4.230.0000.00716.53
7.4.220.0040.00416.27
7.4.210.0050.01016.56
7.4.200.0070.00016.43
7.4.160.0070.00916.54
7.4.140.0120.00617.86
7.4.130.0080.01116.57
7.4.120.0100.01016.52
7.4.110.0170.00016.59
7.4.100.0070.01116.48
7.4.90.0070.01016.70
7.4.80.0040.01619.39
7.4.70.0140.00416.43
7.4.60.0060.01116.68
7.4.50.0040.01416.43
7.4.40.0080.00816.52
7.4.00.0050.01014.76
7.3.330.0000.00513.36
7.3.320.0050.00013.41
7.3.310.0000.00716.38
7.3.300.0080.00016.25
7.3.290.0120.00616.38
7.3.280.0120.00616.34
7.3.260.0080.01216.38
7.3.240.0060.01116.42
7.3.230.0120.00616.32
7.3.210.0090.01216.21
7.3.200.0090.00916.51
7.3.190.0130.00316.66
7.3.180.0080.00816.53
7.3.170.0060.01116.38
7.3.160.0130.00316.41
7.3.120.0130.00914.86
7.3.110.0000.01315.07
7.3.100.0030.01214.78
7.3.90.0030.00614.81
7.3.80.0000.00914.52
7.3.70.0130.00314.62
7.3.60.0120.00314.73
7.3.50.0030.00614.68
7.3.40.0100.00314.66
7.3.30.0060.00914.64
7.3.20.0090.00616.51
7.3.10.0060.00616.54
7.3.00.0080.00416.47
7.2.330.0120.00616.60
7.2.320.0100.00716.62
7.2.310.0120.00616.37
7.2.300.0150.00616.63
7.2.290.0080.00916.84
7.2.250.0090.00915.19
7.2.240.0140.00715.23
7.2.230.0030.01615.09
7.2.220.0070.00715.13
7.2.210.0030.00715.01
7.2.200.0070.00714.93
7.2.190.0090.00615.15
7.2.180.0100.00314.95
7.2.170.0000.00914.81
7.2.60.0030.00917.00
7.2.50.0060.00916.86
7.2.40.0530.01118.04
7.2.30.0690.01018.20
7.2.20.0560.01317.91
7.2.10.0630.00818.11
7.2.00.0580.01118.00
7.1.330.0030.01015.90
7.1.320.0050.00515.88
7.1.310.0040.01215.60
7.1.300.0090.00615.74
7.1.290.0070.00715.77
7.1.280.0060.00615.42
7.1.270.0070.01015.50
7.1.260.0130.00015.79
7.1.200.0000.01015.67
7.1.160.0670.01116.76
7.1.150.0620.01216.79
7.1.140.0600.01016.77
7.1.130.0630.01217.09
7.1.120.0610.00616.87
7.1.110.0600.00816.30
7.1.100.0680.01216.39
7.1.90.1140.01415.99
7.1.80.0830.01516.45
7.1.70.0690.00915.39
7.1.60.0840.01232.94
7.1.50.1320.01332.91
7.1.40.1570.00932.51
7.1.30.0240.01432.67
7.1.20.0950.01432.74
7.1.10.1000.01214.80
7.1.00.0960.00914.91

preferences:
61.28 ms | 401 KiB | 5 Q