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 { public function getInformation($uniqueIdentifier) { $result = $this->cache->get($uniqueIdentifier); if ($result === false) { $result = $this->dataSource->getOne($uniqueIdentifier); $this->cache->set($uniqueIdentifier, $result); } return $result; } } $cachedService = new CachingProxy(new Memcache(), new ImportantService()); $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.60.0100.01318.48
8.3.50.0150.00521.17
8.3.40.0060.00918.73
8.3.30.0110.00418.75
8.3.20.0040.00420.34
8.3.10.0080.00023.57
8.3.00.0080.00017.91
8.2.180.0090.00616.73
8.2.170.0080.00822.96
8.2.160.0030.01020.47
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0060.00317.63
8.2.110.0030.00622.07
8.2.100.0070.00317.84
8.2.90.0000.00819.08
8.2.80.0090.00017.97
8.2.70.0030.00617.48
8.2.60.0000.00818.04
8.2.50.0050.00318.07
8.2.40.0030.00719.21
8.2.30.0040.00422.33
8.2.20.0070.00017.77
8.2.10.0000.00818.03
8.2.00.0000.00718.10
8.1.280.0080.00825.92
8.1.270.0040.00423.79
8.1.260.0040.00426.35
8.1.250.0000.00928.09
8.1.240.0030.00723.63
8.1.230.0030.00920.87
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0050.00517.23
8.1.190.0040.00417.23
8.1.180.0060.00318.10
8.1.170.0080.00018.52
8.1.160.0000.00821.90
8.1.150.0000.00718.80
8.1.140.0040.00417.27
8.1.130.0030.00317.62
8.1.120.0080.00017.39
8.1.110.0070.00017.26
8.1.100.0000.00717.38
8.1.90.0050.00317.27
8.1.80.0030.00617.26
8.1.70.0030.00317.42
8.1.60.0000.00817.58
8.1.50.0050.00317.40
8.1.40.0060.00317.48
8.1.30.0040.00417.52
8.1.20.0000.00817.53
8.1.10.0050.00317.58
8.1.00.0070.00017.46
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00718.43
8.0.270.0000.00817.16
8.0.260.0050.00317.29
8.0.250.0040.00417.05
8.0.240.0030.00516.92
8.0.230.0020.00516.99
8.0.220.0040.00416.87
8.0.210.0070.00016.95
8.0.200.0080.00016.86
8.0.190.0090.00016.98
8.0.180.0040.00417.02
8.0.170.0040.00416.90
8.0.160.0050.00316.91
8.0.150.0070.00016.78
8.0.140.0040.00416.79
8.0.130.0030.00313.37
8.0.120.0030.00616.87
8.0.110.0000.00817.00
8.0.100.0080.00016.80
8.0.90.0000.00716.96
8.0.80.0070.00716.89
8.0.70.0000.00717.04
8.0.60.0040.00416.93
8.0.50.0000.00816.74
8.0.30.0120.00717.12
8.0.20.0090.01117.41
8.0.10.0040.00416.84
8.0.00.0090.01016.76
7.4.330.0050.00015.08
7.4.320.0000.00716.47
7.4.300.0060.00016.49
7.4.290.0040.00416.60
7.4.280.0050.00216.61
7.4.270.0100.00016.58
7.4.260.0080.00016.42
7.4.250.0000.00716.50
7.4.240.0050.00316.54
7.4.230.0030.00316.41
7.4.220.0060.01316.42
7.4.210.0100.01016.53
7.4.200.0060.00316.47
7.4.160.0060.00916.38
7.4.150.0000.01817.40
7.4.140.0080.01117.86
7.4.130.0060.01316.66
7.4.120.0130.00616.56
7.4.110.0170.00416.43
7.4.100.0110.01116.45
7.4.90.0190.00316.55
7.4.80.0180.00619.39
7.4.70.0160.00016.45
7.4.60.0100.00716.57
7.4.50.0060.00016.34
7.4.40.0090.00916.25
7.4.30.0110.00716.44
7.4.00.0030.01214.60
7.3.330.0000.00513.35
7.3.320.0000.00613.36
7.3.310.0000.00616.50
7.3.300.0060.00016.36
7.3.290.0080.00716.34
7.3.280.0090.00716.40
7.3.270.0110.00717.40
7.3.260.0130.00316.69
7.3.240.0000.01916.26
7.3.230.0100.01016.41
7.3.210.0040.01416.45
7.3.200.0040.01916.52
7.3.190.0060.01216.44
7.3.180.0000.01516.48
7.3.170.0140.00316.41
7.3.160.0000.01616.45
7.3.120.0100.00715.02
7.3.110.0070.00714.83
7.3.100.0090.00314.81
7.3.90.0070.00314.86
7.3.80.0070.00715.05
7.3.70.0060.00314.97
7.3.60.0100.00314.98
7.3.50.0030.01314.91
7.3.40.0030.00714.89
7.3.30.0030.01214.86
7.3.20.0110.00016.68
7.3.10.0060.00316.59
7.3.00.0040.00816.52
7.2.330.0060.02016.63
7.2.320.0120.00616.50
7.2.310.0040.01216.66
7.2.300.0030.01316.44
7.2.290.0070.01416.61
7.2.240.0100.00314.85
7.2.230.0080.00714.73
7.2.220.0110.00414.86
7.2.210.0000.01015.20
7.2.200.0080.00814.70
7.2.190.0030.01314.96
7.2.180.0100.00614.86
7.2.170.0040.01114.71
7.2.160.0040.00814.71
7.2.150.0000.01116.84
7.2.140.0030.01016.77
7.2.130.0070.01016.70
7.2.120.0080.00416.84
7.2.110.0100.00316.47
7.2.100.0100.00316.85
7.2.90.0000.02016.85
7.2.80.0070.00716.87
7.2.70.0060.01216.96
7.2.60.0060.00716.73
7.2.50.0040.01116.71
7.2.40.0000.01216.88
7.2.30.0070.01016.91
7.2.20.0120.00316.82
7.2.10.0080.00316.77
7.2.00.0080.00618.04
7.1.330.0100.00315.81
7.1.320.0030.01115.60
7.1.310.0000.01315.65
7.1.300.0000.01115.53
7.1.290.0000.01015.79
7.1.280.0090.00315.67
7.1.270.0070.00315.46
7.1.260.0030.00615.59
7.1.250.0090.00615.66
7.1.200.0030.01015.63
7.1.100.0030.01418.09
7.1.70.0000.00817.07
7.1.60.0060.01919.29
7.1.50.0140.01116.78
7.1.00.0070.07322.45
7.0.200.0000.01016.50
7.0.60.0100.07719.88
7.0.50.0070.07017.90
7.0.40.0030.09020.05
7.0.30.0270.05320.23
7.0.20.0230.07720.21
7.0.10.0030.09020.25
7.0.00.0070.04020.07
5.6.280.0000.03320.92
5.6.210.0070.03720.66
5.6.200.0000.04318.29
5.6.190.0030.06320.41
5.6.180.0630.06720.61
5.6.170.0170.04320.62
5.6.160.0170.04020.44
5.6.150.0030.04018.29
5.6.140.0070.08318.14
5.6.130.0070.08318.13
5.6.120.0070.08020.98
5.6.110.0100.08020.99
5.6.100.0130.06720.98
5.6.90.0070.04020.96
5.6.80.0100.06320.39
5.5.350.0130.07320.46
5.5.340.0100.05018.05
5.5.330.0100.04020.13
5.5.320.0370.07720.52
5.5.310.0370.07020.19
5.5.300.0030.04017.95
5.5.290.0070.08317.98
5.5.280.0100.07320.81
5.5.270.0030.05020.79
5.5.260.0030.07320.80
5.5.250.0130.07320.59
5.5.240.0070.06320.17
5.4.450.0870.06019.55
5.4.440.0970.06019.49
5.4.430.0870.05319.58
5.4.420.0670.05319.60
5.4.410.0970.05719.48
5.4.400.0830.06319.07
5.4.390.0770.06019.28
5.4.380.0730.06019.15
5.4.370.0870.05318.84
5.4.360.1100.07718.85
5.4.350.1170.06718.84
5.4.340.0970.05719.14
5.4.320.0930.05318.87
5.4.310.0930.05019.25
5.4.300.0970.06319.37
5.4.290.0730.06318.98
5.4.280.1030.08019.24
5.4.270.0730.06019.15
5.4.260.0970.06319.14
5.4.250.0700.05718.84
5.4.240.0930.06718.83
5.4.230.1000.06018.83
5.4.220.1070.06019.29
5.4.210.0700.05719.14
5.4.200.0930.05319.25
5.4.190.1130.06318.86
5.4.180.0870.07018.86
5.4.170.0870.04319.14
5.4.160.1000.06019.12
5.4.150.1130.07719.10
5.4.140.0970.08316.39
5.4.130.1070.06316.40
5.4.120.0830.06316.45
5.4.110.0830.07716.33
5.4.100.0830.06716.29
5.4.90.1170.05016.57
5.4.80.0830.05316.66
5.4.70.0170.03716.58
5.4.60.0230.04316.50
5.4.50.0000.05016.43
5.4.40.0230.07016.43
5.4.30.0270.05016.26
5.4.20.0430.05316.43

preferences:
55.47 ms | 401 KiB | 5 Q