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 Memcache { private $data = []; public function set($key, $value) { $this->data[$key] = $value; } public function get($key) { return isset($this->data[$key]) ? $this->data[$key] : false; } } 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.60.0180.00318.39
8.3.50.0150.00521.14
8.3.40.0130.00618.79
8.3.30.0040.01118.85
8.3.20.0070.00020.18
8.3.10.0040.00423.48
8.3.00.0030.00617.80
8.2.180.0060.01018.18
8.2.170.0070.01022.96
8.2.160.0080.00620.57
8.2.150.0140.00624.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0050.00317.63
8.2.110.0060.00622.24
8.2.100.0060.00617.80
8.2.90.0000.00719.05
8.2.80.0000.00817.97
8.2.70.0060.00317.50
8.2.60.0000.01017.90
8.2.50.0060.00318.07
8.2.40.0030.00619.39
8.2.30.0050.00320.67
8.2.20.0030.00517.78
8.2.10.0080.00017.98
8.2.00.0040.00417.92
8.1.280.0060.01025.92
8.1.270.0140.00323.68
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00622.53
8.1.230.0080.00419.14
8.1.220.0040.00417.76
8.1.210.0080.00018.77
8.1.200.0000.01017.48
8.1.190.0050.00317.35
8.1.180.0000.00918.10
8.1.170.0000.00918.71
8.1.160.0040.00421.93
8.1.150.0050.00218.81
8.1.140.0040.00417.39
8.1.130.0000.01017.49
8.1.120.0060.00317.36
8.1.110.0020.00517.40
8.1.100.0040.00417.35
8.1.90.0040.00417.49
8.1.80.0050.00417.50
8.1.70.0000.00717.34
8.1.60.0000.00917.67
8.1.50.0000.00917.62
8.1.40.0040.00417.54
8.1.30.0040.00417.63
8.1.20.0080.00017.73
8.1.10.0000.00717.66
8.1.00.0030.00617.45
8.0.300.0000.00718.77
8.0.290.0000.00716.88
8.0.280.0000.00718.44
8.0.270.0070.00017.16
8.0.260.0080.00016.88
8.0.250.0060.00317.03
8.0.240.0040.00417.04
8.0.230.0000.00717.05
8.0.220.0030.00316.94
8.0.210.0040.00416.94
8.0.200.0000.00616.94
8.0.190.0040.00417.00
8.0.180.0050.00316.89
8.0.170.0080.00016.93
8.0.160.0030.00616.91
8.0.150.0040.00416.79
8.0.140.0050.00216.95
8.0.130.0000.00513.44
8.0.120.0000.00816.95
8.0.110.0020.00516.90
8.0.100.0060.00316.99
8.0.90.0080.00016.82
8.0.80.0080.01116.95
8.0.70.0040.00416.73
8.0.60.0070.00016.98
8.0.50.0000.00816.83
8.0.30.0070.01017.02
8.0.20.0120.00717.40
8.0.10.0030.00516.90
8.0.00.0110.00716.83
7.4.330.0020.00215.08
7.4.320.0000.00716.61
7.4.300.0000.00816.56
7.4.290.0040.00416.59
7.4.280.0000.00716.41
7.4.270.0000.00916.66
7.4.260.0000.00816.69
7.4.250.0040.00416.48
7.4.240.0040.00416.60
7.4.230.0030.00316.73
7.4.220.0100.00916.71
7.4.210.0060.01416.68
7.4.200.0030.00316.71
7.4.160.0140.00316.28
7.4.150.0110.00717.40
7.4.140.0120.01017.86
7.4.130.0100.00816.42
7.4.120.0130.00616.57
7.4.110.0120.00416.48
7.4.100.0100.00916.49
7.4.90.0060.01216.61
7.4.80.0100.01319.39
7.4.70.0000.01616.58
7.4.60.0080.00816.52
7.4.50.0050.00316.23
7.4.40.0200.00816.73
7.4.30.0120.00916.50
7.4.10.0080.00915.21
7.4.00.0070.01114.92
7.3.330.0000.00513.23
7.3.320.0000.00713.28
7.3.310.0060.00016.43
7.3.300.0030.00316.45
7.3.290.0070.00916.40
7.3.280.0120.01016.39
7.3.270.0070.01117.40
7.3.260.0080.01116.69
7.3.250.0130.00816.42
7.3.240.0140.00716.31
7.3.230.0080.00816.40
7.3.210.0030.01316.63
7.3.200.0070.01316.32
7.3.190.0120.00916.48
7.3.180.0090.00616.59
7.3.170.0130.00316.36
7.3.160.0100.01016.35
7.3.130.0030.01614.70
7.3.120.0080.01014.86
7.3.110.0090.00614.80
7.3.100.0020.01114.85
7.3.90.0090.00514.93
7.3.80.0030.01014.88
7.3.70.0070.00514.90
7.3.60.0050.00614.87
7.3.50.0090.00414.67
7.3.40.0030.00814.89
7.3.30.0050.00914.59
7.3.20.0070.00716.45
7.3.10.0030.00916.59
7.3.00.0060.00516.59
7.2.330.0130.00516.65
7.2.320.0090.02116.66
7.2.310.0000.01716.66
7.2.300.0150.00616.69
7.2.290.0090.01216.59
7.2.260.0080.00914.62
7.2.250.0070.00915.04
7.2.240.0030.01214.96
7.2.230.0050.01114.99
7.2.220.0100.00615.07
7.2.210.0070.00514.94
7.2.200.0060.00514.91
7.2.190.0020.01314.83
7.2.180.0010.01014.72
7.2.170.0070.00315.09
7.2.160.0030.01014.93
7.2.150.0090.00716.75
7.2.140.0060.00816.57
7.2.130.0040.01116.76
7.2.120.0070.00716.68
7.2.110.0060.00616.68
7.2.100.0070.00916.94
7.2.90.0020.01016.73
7.2.80.0030.01216.70
7.2.70.0060.00616.84
7.2.60.0030.00816.76
7.2.50.0070.01016.69
7.2.40.0050.00816.89
7.2.30.0050.00816.71
7.2.20.0030.00916.77
7.2.10.0060.00616.70
7.2.00.0060.01217.51
7.1.330.0060.00915.41
7.1.320.0060.00615.65
7.1.310.0050.00815.57
7.1.300.0050.01115.69
7.1.290.0040.00615.48
7.1.280.0030.00615.65
7.1.270.0090.00915.55
7.1.260.0030.00715.45
7.1.250.0000.01315.57
7.1.240.0080.00615.83
7.1.230.0040.01015.70
7.1.220.0070.00915.47
7.1.210.0060.00715.68
7.1.200.0060.00615.55
7.1.190.0030.00815.57
7.1.180.0100.00515.78
7.1.170.0060.00615.63
7.1.160.0070.00415.54
7.1.150.0060.00615.50
7.1.140.0000.01315.71
7.1.130.0090.00615.61
7.1.120.0110.00515.43
7.1.110.0050.00715.69
7.1.100.0060.00716.44
7.1.90.0070.00815.67
7.1.80.0060.00815.68
7.1.70.0090.00616.09
7.1.60.0080.00916.82
7.1.50.0040.01016.07
7.1.40.0080.00815.59
7.1.30.0060.00815.54
7.1.20.0070.00815.76
7.1.10.0050.00915.69
7.1.00.0080.02817.87
7.0.330.0050.00515.37
7.0.320.0040.00715.28
7.0.310.0070.00715.35
7.0.300.0030.00815.42
7.0.290.0030.00815.35
7.0.280.0010.01015.21
7.0.270.0080.00515.37
7.0.260.0020.01115.29
7.0.250.0030.00715.48
7.0.240.0020.00915.17
7.0.230.0100.00615.21
7.0.220.0070.00615.35
7.0.210.0000.01215.26
7.0.200.0020.00715.78
7.0.190.0070.00915.36
7.0.180.0050.00615.41
7.0.170.0100.00515.28
7.0.160.0080.00515.48
7.0.150.0040.00915.40
7.0.140.0060.00615.33
7.0.130.0080.00815.28
7.0.120.0080.00515.21
7.0.110.0070.00615.23
7.0.100.0050.02116.92
7.0.90.0050.02116.96
7.0.80.0110.01516.83
7.0.70.0080.02616.84
7.0.60.0080.03116.84
7.0.50.0080.01817.10
7.0.40.0120.02915.70
7.0.30.0090.01615.74
7.0.20.0100.02215.68
7.0.10.0030.02515.74
7.0.00.0060.01615.70
5.6.400.0040.00714.33
5.6.390.0090.00314.44
5.6.380.0110.00314.29
5.6.370.0070.00714.04
5.6.360.0050.00714.46
5.6.350.0050.00614.45
5.6.340.0030.00714.30
5.6.330.0030.01314.21
5.6.320.0070.00714.50
5.6.310.0050.00514.28
5.6.300.0070.00814.43
5.6.290.0040.00914.21
5.6.280.0050.01716.46
5.6.270.0080.00714.16
5.6.260.0050.00714.46
5.6.250.0040.01916.47
5.6.240.0060.01416.38
5.6.230.0030.02316.35
5.6.220.0100.01816.31
5.6.210.0050.02316.36
5.6.200.0060.03316.59
5.6.190.0100.01516.40
5.6.180.0090.02616.39
5.6.170.0070.02316.46
5.6.160.0060.02816.49
5.6.150.0070.02316.54
5.6.140.0070.02816.59
5.6.130.0080.03516.49
5.6.120.0080.02116.44
5.6.110.0090.03016.56
5.6.100.0050.03816.54
5.6.90.0040.03216.62
5.6.80.0080.02916.25
5.6.70.0040.03116.29
5.6.60.0090.02716.29
5.6.50.0080.03016.38
5.6.40.0110.02116.21
5.6.30.0020.02916.32
5.6.20.0080.02416.44
5.6.10.0060.02716.30
5.6.00.0060.01916.18
5.5.380.0030.01716.18
5.5.370.0050.01916.27
5.5.360.0020.02916.32
5.5.350.0090.03016.19
5.5.340.0070.03116.39
5.5.330.0050.03216.51
5.5.320.0090.02616.38
5.5.310.0100.03316.42
5.5.300.0060.02916.52
5.5.290.0120.02116.49
5.5.280.0080.01916.37
5.5.270.0050.03416.33
5.5.260.0120.02716.35
5.5.250.0110.03116.29
5.5.240.0120.02416.21
5.5.230.0060.03316.16
5.5.220.0040.03216.12
5.5.210.0070.01915.98
5.5.200.0070.03216.04
5.5.190.0090.02816.17
5.5.180.0050.02716.20
5.5.170.0040.00914.17
5.5.160.0100.01616.09
5.5.150.0070.03116.13
5.5.140.0050.03316.04
5.5.130.0040.02616.14
5.5.120.0080.03016.05
5.5.110.0060.03116.02
5.5.100.0060.03016.14
5.5.90.0050.02016.15
5.5.80.0100.02416.10
5.5.70.0060.02516.09
5.5.60.0030.03316.17
5.5.50.0070.02116.21
5.5.40.0080.01716.17
5.5.30.0050.02716.18
5.5.20.0100.02616.05
5.5.10.0090.02916.02
5.5.00.0100.02516.14
5.4.450.0030.02214.76
5.4.440.0050.03214.66
5.4.430.0090.02814.72
5.4.420.0050.03114.70
5.4.410.0040.03214.72
5.4.400.0070.02614.46
5.4.390.0070.03014.57
5.4.380.0050.02914.65
5.4.370.0070.02514.52
5.4.360.0060.02814.55
5.4.350.0060.02614.54
5.4.340.0030.02714.63
5.4.330.0040.00712.21
5.4.320.0070.01914.60
5.4.310.0030.02114.62
5.4.300.0050.02314.57
5.4.290.0080.01414.52
5.4.280.0060.03014.60
5.4.270.0060.02114.56
5.4.260.0050.02914.40
5.4.250.0050.02614.60
5.4.240.0090.02414.53
5.4.230.0030.03114.67
5.4.220.0060.01714.63
5.4.210.0130.02414.54
5.4.200.0090.02114.53
5.4.190.0020.02114.64
5.4.180.0060.01814.59
5.4.170.0060.02814.37
5.4.160.0100.02514.46
5.4.150.0040.03114.53
5.4.140.0110.02313.69
5.4.130.0050.02113.67
5.4.120.0060.02913.71
5.4.110.0030.01713.70
5.4.100.0040.01513.64
5.4.90.0010.01713.70
5.4.80.0030.01713.75
5.4.70.0050.02613.71
5.4.60.0050.02613.71
5.4.50.0030.01513.69
5.4.40.0050.02613.68
5.4.30.0040.02113.67
5.4.20.0060.01413.72
5.4.10.0090.02313.68
5.4.00.0010.02713.55

preferences:
60.01 ms | 401 KiB | 5 Q