3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CachingProxy { private $cache = null; private $instance = null; public function __construct(Memcache $cache, $instance) { $this->cache = $cache; $this->instance = $instance; } public function __call($method, $arguments) { var_dump($method, $arguments); die; if (substr($method, 0, 3) !== 'get') { $result = call_user_func_array($method, $arguments); } else { $uniqueId = $method . serialize($arguments); $result = $this->cache->get($uniqueId); if ($result === false) { $result = call_user_func_array($method, $arguments); $this->cache->set($uniqueId, $result); } } return $result; } } class ImportantService { } $service = new ImportantService(); $cachedService = new CachingProxy($memcacheInstance, $service); $result = $cachedService->getInformation(123); // First call goes to a data source $more = $cachedService->getInformation(123); // From cache now

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.0070.00716.63
8.3.60.0100.01018.68
8.3.50.0170.00321.13
8.3.40.0090.00918.63
8.3.30.0040.01218.66
8.3.20.0030.01020.16
8.3.10.0040.00423.60
8.3.00.0090.00019.68
8.2.190.0070.00716.84
8.2.180.0120.00318.29
8.2.170.0110.00322.96
8.2.160.0170.00020.35
8.2.150.0160.00024.18
8.2.140.0050.00324.66
8.2.130.0020.00526.16
8.2.120.0000.00819.96
8.2.110.0060.00322.10
8.2.100.0060.00618.04
8.2.90.0040.00419.05
8.2.80.0030.00617.97
8.2.70.0060.00317.50
8.2.60.0040.00417.91
8.2.50.0080.00018.07
8.2.40.0090.00019.32
8.2.30.0050.00320.64
8.2.20.0000.00817.77
8.2.10.0040.00417.93
8.2.00.0030.00618.03
8.1.280.0070.00725.92
8.1.270.0090.00923.96
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0030.00622.58
8.1.230.0080.00417.79
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0090.00017.23
8.1.190.0000.00817.23
8.1.180.0030.00518.10
8.1.170.0030.00618.59
8.1.160.0040.00422.11
8.1.150.0030.00618.88
8.1.140.0030.00517.36
8.1.130.0030.00317.61
8.1.120.0070.00017.34
8.1.110.0070.00017.38
8.1.100.0040.00417.47
8.1.90.0040.00417.51
8.1.80.0040.00417.50
8.1.70.0050.00317.38
8.1.60.0000.00717.55
8.1.50.0000.00817.45
8.1.40.0030.00517.46
8.1.30.0000.00817.60
8.1.20.0000.00817.70
8.1.10.0040.00417.52
8.1.00.0050.00217.39
8.0.300.0080.00018.84
8.0.290.0040.00416.88
8.0.280.0000.00718.43
8.0.270.0030.00317.14
8.0.260.0000.00617.23
8.0.250.0040.00417.01
8.0.240.0080.00016.98
8.0.230.0000.00716.97
8.0.220.0070.00016.89
8.0.210.0000.00716.89
8.0.200.0030.00317.01
8.0.190.0060.00316.89
8.0.180.0040.00416.84
8.0.170.0050.00216.99
8.0.160.0070.00016.91
8.0.150.0030.00316.84
8.0.140.0000.00816.88
8.0.130.0030.00313.32
8.0.120.0000.00816.79
8.0.110.0040.00416.84
8.0.100.0040.00417.03
8.0.90.0020.00517.06
8.0.80.0120.00417.00
8.0.70.0080.00016.98
8.0.60.0040.00416.79
8.0.50.0030.00516.78
8.0.30.0060.01317.34
8.0.20.0100.01217.40
8.0.10.0040.00416.84
8.0.00.0140.00516.75
7.4.330.0050.00015.08
7.4.320.0050.00316.40
7.4.300.0060.00016.54
7.4.290.0000.00716.65
7.4.280.0080.00016.53
7.4.270.0000.00916.53
7.4.260.0070.00016.63
7.4.250.0040.00416.41
7.4.240.0040.00316.60
7.4.230.0080.00016.39
7.4.220.0140.01016.59
7.4.210.0090.01216.61
7.4.200.0000.00716.55
7.4.160.0050.01616.53
7.4.150.0110.00617.40
7.4.140.0150.00617.86
7.4.130.0060.01016.49
7.4.120.0120.00916.62
7.4.110.0070.01016.67
7.4.100.0100.01316.72
7.4.90.0060.01116.45
7.4.80.0100.00719.39
7.4.70.0170.00016.56
7.4.60.0080.00816.51
7.4.50.0040.00416.58
7.4.40.0230.00016.70
7.4.30.0130.00316.55
7.4.00.0060.00614.98
7.3.330.0050.00013.41
7.3.320.0030.00313.38
7.3.310.0000.00716.26
7.3.300.0030.00316.41
7.3.290.0040.01016.40
7.3.280.0080.01116.36
7.3.270.0100.00717.40
7.3.260.0100.00716.39
7.3.250.0110.00716.50
7.3.240.0100.01016.55
7.3.230.0130.01016.41
7.3.210.0100.00716.47
7.3.200.0260.01516.35
7.3.190.0090.00916.63
7.3.180.0100.00716.39
7.3.170.0060.01216.47
7.3.160.0100.00716.53
7.3.10.0070.00716.73
7.3.00.0000.01316.69
7.2.330.0070.01416.62
7.2.320.0100.00716.51
7.2.310.0130.01016.78
7.2.300.0060.01016.63
7.2.290.0170.00616.34
7.2.130.0070.00716.57
7.2.120.0060.00516.99
7.2.110.0070.00716.88
7.2.100.0120.00016.78
7.2.90.0090.00616.74
7.2.80.0090.00916.42
7.2.70.0000.01116.92
7.2.60.0090.01516.83
7.2.50.0060.00916.69
7.2.40.0000.01216.96
7.2.30.0070.00716.90
7.2.20.0040.00716.70
7.2.10.0030.00616.88
7.2.00.0030.00816.65
7.1.250.0000.01015.49
7.1.200.0030.01315.59
7.1.100.0060.00617.91
7.1.70.0000.00716.80
7.1.60.0100.01419.29
7.1.50.0070.00716.73
7.1.00.0000.08022.32
7.0.200.0000.00816.70
7.0.60.0030.07720.04
7.0.50.0030.08317.88
7.0.40.0070.04720.40
7.0.30.0230.05720.26
7.0.20.0430.06720.33
7.0.10.0000.04720.13
7.0.00.0070.08720.20
5.6.280.0030.03021.12
5.6.210.0130.04720.74
5.6.200.0070.08318.16
5.6.190.0070.07720.50
5.6.180.0230.04320.48
5.6.170.0200.07720.47
5.6.160.0070.08320.33
5.6.150.0070.03318.12
5.6.140.0000.05718.19
5.6.130.0030.04018.20
5.6.120.0000.04721.10
5.6.110.0130.07720.89
5.6.100.0030.04321.03
5.6.90.0030.08321.13
5.6.80.0030.04320.38
5.5.350.0070.07320.39
5.5.340.0200.06717.99
5.5.330.0070.07320.21
5.5.320.0370.05320.38
5.5.310.0230.08320.23
5.5.300.0030.04017.94
5.5.290.0170.07717.92
5.5.280.0000.04320.88
5.5.270.0000.07720.87
5.5.260.0100.07720.85
5.5.250.0070.08720.51
5.5.240.0000.07720.27
5.4.450.0830.08719.58
5.4.440.0970.07719.31
5.4.430.0830.07319.58
5.4.420.0870.08019.16
5.4.410.0900.07719.21
5.4.400.0800.05319.29
5.4.390.0870.05719.32
5.4.380.0700.06719.29
5.4.370.0870.05019.28
5.4.360.0930.06319.05
5.4.350.0730.06719.14
5.4.340.0870.06019.38
5.4.320.0870.06019.30
5.4.310.0770.08019.29
5.4.300.1100.07019.27
5.4.290.0970.07018.86
5.4.280.0930.07019.14
5.4.270.1030.06319.01
5.4.260.1230.05719.14
5.4.250.0830.07019.14
5.4.240.0900.06319.14
5.4.230.0870.07319.05
5.4.220.1000.05719.19
5.4.210.1100.05719.27
5.4.200.0870.06319.29
5.4.190.0830.07019.14
5.4.180.0900.05019.27
5.4.170.0800.06319.16
5.4.160.0570.07019.20
5.4.150.1030.05719.23
5.4.140.0930.07016.45
5.4.130.0700.07316.36
5.4.120.1100.05016.40
5.4.110.0770.07016.67
5.4.100.1170.05316.63
5.4.90.1170.06016.56
5.4.80.1070.05716.48
5.4.70.0130.03316.57
5.4.60.0030.03716.55
5.4.50.0030.07016.43
5.4.40.0270.06016.43
5.4.30.0300.03716.32
5.4.20.0300.07316.51

preferences:
29.95 ms | 401 KiB | 5 Q