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) { 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) { echo 'banana'; } } $cachedService = new CachingProxy(new Memcache(), new ImportantService()); $result = $cachedService->getInformation(1234); // First call goes to a data source $more = $cachedService->getInformation(1234); // 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.0140.00618.43
8.3.50.0150.00721.09
8.3.40.0110.00718.79
8.3.30.0110.00718.71
8.3.20.0110.00720.21
8.3.10.0080.00023.66
8.3.00.0080.00017.67
8.2.180.0100.01316.50
8.2.170.0200.00022.96
8.2.160.0100.00720.41
8.2.150.0110.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0090.00017.38
8.2.110.0080.00422.07
8.2.100.0090.00319.53
8.2.90.0050.00319.09
8.2.80.0000.00817.97
8.2.70.0030.00617.50
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0060.00619.52
8.2.30.0050.00322.28
8.2.20.0040.00417.70
8.2.10.0000.00818.00
8.2.00.0050.00318.04
8.1.280.0060.00925.92
8.1.270.0000.00823.96
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00922.64
8.1.230.0060.00617.64
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0070.00317.22
8.1.190.0000.00817.13
8.1.180.0040.00418.10
8.1.170.0030.00518.49
8.1.160.0000.00721.96
8.1.150.0000.00718.69
8.1.140.0040.00417.23
8.1.130.0030.00317.54
8.1.120.0030.00317.34
8.1.110.0070.00017.29
8.1.100.0030.00417.41
8.1.90.0030.00417.25
8.1.80.0000.00817.39
8.1.70.0030.00317.32
8.1.60.0000.00917.55
8.1.50.0090.00017.47
8.1.40.0000.00817.36
8.1.30.0060.00317.59
8.1.20.0040.00417.61
8.1.10.0050.00217.57
8.1.00.0030.00517.47
8.0.300.0000.00718.77
8.0.290.0000.01016.75
8.0.280.0040.00418.38
8.0.270.0040.00417.10
8.0.260.0060.00017.09
8.0.250.0040.00416.87
8.0.240.0000.00816.84
8.0.230.0070.00016.97
8.0.220.0040.00416.81
8.0.210.0000.00716.80
8.0.200.0070.00017.01
8.0.190.0080.00016.94
8.0.180.0000.00716.82
8.0.170.0030.00516.82
8.0.160.0000.00716.90
8.0.150.0070.00016.82
8.0.140.0040.00416.90
8.0.130.0000.00613.33
8.0.120.0000.00816.91
8.0.110.0040.00416.90
8.0.100.0000.00817.02
8.0.90.0000.00716.88
8.0.80.0090.01216.89
8.0.70.0040.00416.68
8.0.60.0000.00716.97
8.0.50.0000.00716.77
8.0.30.0080.00716.98
8.0.20.0090.00917.40
8.0.10.0040.00417.07
8.0.00.0120.00916.71
7.4.330.0030.00315.08
7.4.320.0050.00316.48
7.4.300.0000.00616.59
7.4.290.0030.00316.59
7.4.280.0030.00616.44
7.4.270.0000.00916.53
7.4.260.0070.00016.60
7.4.250.0040.00416.44
7.4.240.0000.00716.57
7.4.230.0070.00016.62
7.4.220.0150.01216.46
7.4.210.0080.01216.57
7.4.200.0080.00016.45
7.4.160.0080.00816.34
7.4.150.0060.01217.40
7.4.140.0110.00917.86
7.4.130.0110.00616.47
7.4.120.0130.00516.65
7.4.110.0140.00316.43
7.4.100.0160.00816.59
7.4.90.0100.00716.26
7.4.80.0030.01519.39
7.4.70.0100.01016.45
7.4.60.0090.00616.50
7.4.50.0040.00416.47
7.4.40.0060.01516.52
7.4.30.0030.01416.51
7.4.10.0070.01014.64
7.4.00.0070.00914.64
7.3.330.0000.00613.31
7.3.320.0060.00013.36
7.3.310.0000.00716.36
7.3.300.0070.00016.36
7.3.290.0110.00516.34
7.3.280.0070.00916.37
7.3.270.0060.01017.40
7.3.260.0030.01316.33
7.3.250.0090.00916.37
7.3.240.0080.01116.36
7.3.230.0070.01016.39
7.3.210.0040.01216.34
7.3.200.0110.00716.31
7.3.190.0030.01416.37
7.3.180.0040.01116.41
7.3.170.0110.00716.51
7.3.160.0090.00616.29
7.3.130.0040.01115.01
7.3.120.0090.00914.93
7.3.110.0090.00614.88
7.3.100.0050.00814.48
7.3.90.0040.01114.95
7.3.80.0060.00614.77
7.3.70.0060.00614.40
7.3.60.0080.00014.63
7.3.50.0060.00614.48
7.3.40.0030.00714.61
7.3.30.0030.01014.46
7.3.20.0090.00316.60
7.3.10.0040.00916.34
7.3.00.0060.00816.42
7.2.330.0100.00716.43
7.2.320.0200.00016.67
7.2.310.0000.02016.49
7.2.300.0030.01416.57
7.2.290.0160.00616.68
7.2.260.0070.00714.90
7.2.250.0140.00314.52
7.2.240.0030.01414.56
7.2.230.0040.01314.74
7.2.220.0000.01314.98
7.2.210.0000.01415.02
7.2.200.0040.01114.93
7.2.190.0070.00714.83
7.2.180.0040.01414.61
7.2.170.0100.00314.65
7.2.160.0070.01014.64
7.2.150.0110.00416.54
7.2.140.0030.01416.77
7.2.130.0090.00416.61
7.2.120.0110.00616.67
7.2.110.0070.00416.62
7.2.100.0050.00916.61
7.2.90.0050.00616.70
7.2.80.0060.00616.43
7.2.70.0070.00816.63
7.2.60.0060.00616.49
7.2.50.0050.00816.58
7.2.40.0060.00816.58
7.2.30.0070.00716.68
7.2.20.0060.00716.73
7.2.10.0110.00316.66
7.2.00.0040.00917.43
7.1.330.0000.01415.58
7.1.320.0030.01015.57
7.1.310.0120.00315.33
7.1.300.0070.00315.49
7.1.290.0030.00515.68
7.1.280.0100.00315.31
7.1.270.0110.00715.55
7.1.260.0030.01015.70
7.1.250.0080.00515.49
7.1.240.0090.00615.54
7.1.230.0070.00715.63
7.1.220.0110.00415.36
7.1.210.0040.01115.34
7.1.200.0030.00715.59
7.1.190.0040.01215.66
7.1.180.0040.01115.55
7.1.170.0060.00615.32
7.1.160.0000.01515.62
7.1.150.0040.00815.33
7.1.140.0040.00815.45
7.1.130.0070.00415.61
7.1.120.0040.01115.59
7.1.110.0100.00715.38
7.1.100.0080.00516.75
7.1.90.0030.01315.72
7.1.80.0000.01115.63
7.1.70.0050.00816.11
7.1.60.0090.01017.38
7.1.50.0080.01025.09
7.1.40.0090.00015.44
7.1.30.0080.00315.61
7.1.20.0110.00315.57
7.1.10.0040.01115.64
7.1.00.0020.04318.97
7.0.330.0070.00315.02
7.0.320.0030.01315.23
7.0.310.0060.00615.20
7.0.300.0080.00415.18
7.0.290.0060.01014.97
7.0.280.0070.00415.17
7.0.270.0060.00615.06
7.0.260.0000.01115.26
7.0.250.0070.00315.13
7.0.240.0040.00815.13
7.0.230.0060.01015.08
7.0.220.0070.00715.13
7.0.210.0040.00415.40
7.0.200.0030.00715.79
7.0.190.0090.00615.24
7.0.180.0140.00015.39
7.0.170.0030.01015.28
7.0.160.0060.00615.34
7.0.150.0030.01015.48
7.0.140.0040.01115.32
7.0.130.0030.00715.19
7.0.120.0040.00715.43
7.0.110.0040.01115.17
7.0.100.0070.00415.39
7.0.90.0030.00815.21
7.0.80.0040.00415.31
7.0.70.0070.00715.29
7.0.60.0020.02617.61
7.0.50.0100.03816.47
7.0.40.0100.02316.86
7.0.30.0230.04216.79
7.0.20.0100.02916.59
7.0.10.0100.04516.62
7.0.00.0060.02216.70
5.6.400.0070.00813.94
5.6.390.0050.00514.63
5.6.380.0060.00914.46
5.6.370.0090.00614.20
5.6.360.0060.00614.10
5.6.350.0030.01014.45
5.6.340.0070.00714.45
5.6.330.0030.01014.16
5.6.320.0040.00414.30
5.6.310.0140.00014.00
5.6.300.0040.01114.52
5.6.290.0040.00414.31
5.6.280.0070.01517.60
5.6.270.0000.01413.92
5.6.260.0120.00314.43
5.6.250.0040.01114.16
5.6.240.0030.01114.26
5.6.230.0060.00914.02
5.6.220.0060.00914.23
5.6.210.0040.02417.61
5.6.200.0050.02316.32
5.6.190.0070.02917.31
5.6.180.0270.03717.34
5.6.170.0200.03817.34
5.6.160.0100.04117.40
5.6.150.0020.02616.18
5.6.140.0020.03716.10
5.6.130.0040.02116.02
5.6.120.0050.03017.61
5.6.110.0090.04117.71
5.6.100.0050.04517.54
5.6.90.0080.04617.73
5.6.80.0080.04317.30
5.6.70.0060.00614.38
5.6.60.0000.01314.23
5.6.50.0030.01013.89
5.6.40.0070.00714.18
5.6.30.0110.00014.25
5.6.20.0100.00314.02
5.6.10.0040.01113.97
5.6.00.0090.00313.92
5.5.380.0000.01114.06
5.5.370.0120.00314.14
5.5.360.0100.00314.30
5.5.350.0060.03517.30
5.5.340.0080.04215.95
5.5.330.0070.02617.30
5.5.320.0120.02317.21
5.5.310.0160.02517.31
5.5.300.0060.02016.03
5.5.290.0050.02016.14
5.5.280.0050.03317.46
5.5.270.0070.04617.38
5.5.260.0050.03517.57
5.5.250.0040.04317.45
5.5.240.0070.04017.04
5.5.230.0060.00913.80
5.5.220.0040.00714.20
5.5.210.0090.00314.05
5.5.200.0050.00814.13
5.5.190.0030.01013.91
5.5.180.0060.01213.95
5.5.170.0120.00414.13
5.5.160.0130.00414.18
5.5.150.0080.00813.82
5.5.140.0070.01313.84
5.5.130.0080.00413.90
5.5.120.0060.01214.15
5.5.110.0050.01114.20
5.5.100.0000.01514.25
5.5.90.0130.00014.02
5.5.80.0100.00313.63
5.5.70.0060.01213.88
5.5.60.0030.00913.78
5.5.50.0080.00813.96
5.5.40.0080.01214.00
5.5.30.0100.00714.11
5.5.20.0070.00713.67
5.5.10.0130.00313.78
5.5.00.0110.00713.85
5.4.450.0470.04215.18
5.4.440.0510.04415.23
5.4.430.0550.03515.16
5.4.420.0080.03115.21
5.4.410.0170.03114.98
5.4.400.0410.03315.02
5.4.390.0500.03014.88
5.4.380.0550.03314.99
5.4.370.0400.03515.03
5.4.360.0550.02715.11
5.4.350.0400.03315.01
5.4.340.0420.04015.11
5.4.330.0000.00710.54
5.4.320.0520.03814.98
5.4.310.0520.04215.15
5.4.300.0390.03515.02
5.4.290.0370.04515.15
5.4.280.0400.03514.89
5.4.270.0370.03714.79
5.4.260.0430.03515.13
5.4.250.0500.03814.88
5.4.240.0400.04315.06
5.4.230.0540.04415.08
5.4.220.0560.02814.85
5.4.210.0600.03014.76
5.4.200.0430.03915.15
5.4.190.0450.04214.96
5.4.180.0350.03714.98
5.4.170.0470.03014.93
5.4.160.0400.04314.97
5.4.150.0440.03714.81
5.4.140.0370.03413.73
5.4.130.0420.02513.82
5.4.120.0410.02813.73
5.4.110.0400.03713.82
5.4.100.0430.02813.63
5.4.90.0400.02513.73
5.4.80.0370.03613.79
5.4.70.0150.03313.58
5.4.60.0130.02013.71
5.4.50.0080.03313.62
5.4.40.0080.02513.71
5.4.30.0140.03313.71
5.4.20.0180.02513.44
5.4.10.0070.00410.95
5.4.00.0070.00710.95

preferences:
57.91 ms | 401 KiB | 5 Q