3v4l.org

run code in 300+ PHP versions simultaneously
<?php function memoize($func) { return function () use ($func) { static $cache = []; $args = func_get_args(); $key = md5(serialize($args)); if ( !isset($cache[$key]) ) { $cache[$key] = call_user_func_array($func, $args); } return $cache[$key]; }; }; $cube = function($number) { return $number * $number * $number; }; $cube3 = memoize($cube, 3); echo $cube3();

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.0150.00416.50
8.3.50.0140.00821.97
8.3.40.0090.00618.62
8.3.30.0120.00318.68
8.3.20.0030.00520.39
8.3.10.0000.00923.48
8.3.00.0050.00319.38
8.2.180.0110.00718.13
8.2.170.0080.00522.96
8.2.160.0110.00321.99
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0060.00617.63
8.2.120.0030.00526.35
8.2.110.0060.00320.38
8.2.100.0090.00318.05
8.2.90.0050.00319.35
8.2.80.0040.00417.97
8.2.70.0050.00317.88
8.2.60.0080.00017.79
8.2.50.0000.00818.07
8.2.40.0060.00319.59
8.2.30.0070.00020.70
8.2.20.0060.00317.89
8.2.10.0060.00318.17
8.2.00.0040.00418.18
8.1.280.0170.00325.92
8.1.270.0000.00823.79
8.1.260.0030.00528.09
8.1.250.0050.00328.09
8.1.240.0030.00722.14
8.1.230.0060.00619.57
8.1.220.0030.00517.79
8.1.210.0050.00318.77
8.1.200.0030.00617.48
8.1.190.0000.00817.23
8.1.180.0030.00518.10
8.1.170.0000.00720.16
8.1.160.0080.00022.04
8.1.150.0000.00918.98
8.1.140.0040.00419.47
8.1.130.0080.00017.71
8.1.120.0070.00017.49
8.1.110.0000.00817.48
8.1.100.0040.00417.37
8.1.90.0060.00317.45
8.1.80.0040.00417.42
8.1.70.0030.00317.43
8.1.60.0040.00417.61
8.1.50.0040.00417.43
8.1.40.0050.00317.50
8.1.30.0040.00417.61
8.1.20.0000.00817.63
8.1.10.0030.00517.66
8.1.00.0050.00317.42
8.0.300.0040.00418.77
8.0.290.0060.00316.75
8.0.280.0030.00318.50
8.0.270.0030.00317.33
8.0.260.0000.00717.14
8.0.250.0030.00317.04
8.0.240.0040.00417.05
8.0.230.0040.00717.00
8.0.220.0070.00016.91
8.0.210.0040.00416.86
8.0.200.0000.00616.97
8.0.190.0070.00316.98
8.0.180.0050.00216.98
8.0.170.0050.00317.00
8.0.160.0000.00717.04
8.0.150.0000.00816.96
8.0.140.0040.00416.84
8.0.130.0030.00313.41
8.0.120.0000.00816.96
8.0.110.0050.00216.96
8.0.100.0040.00416.76
8.0.90.0040.00416.91
8.0.80.0030.01316.89
8.0.70.0000.00816.99
8.0.60.0000.00816.85
8.0.50.0040.00416.89
8.0.30.0080.01017.11
8.0.20.0100.01217.40
8.0.10.0070.00016.97
8.0.00.0060.01216.73
7.4.330.0060.00016.80
7.4.320.0030.00316.59
7.4.300.0000.00616.46
7.4.290.0030.00516.41
7.4.280.0000.00816.61
7.4.270.0060.00016.43
7.4.260.0030.00616.41
7.4.250.0000.00716.34
7.4.240.0050.00216.55
7.4.230.0000.00716.42
7.4.220.0090.00916.72
7.4.210.0060.00916.43
7.4.200.0000.00716.51
7.4.160.0030.01216.54
7.4.150.0150.00317.40
7.4.140.0160.01017.86
7.4.130.0110.01116.54
7.4.120.0130.00916.58
7.4.110.0060.01516.66
7.4.100.0150.00916.46
7.4.90.0140.00716.62
7.4.80.0060.01319.39
7.4.70.0130.01016.73
7.4.60.0100.00716.51
7.4.50.0160.00016.57
7.4.40.0030.01416.72
7.4.30.0070.01016.54
7.4.10.0060.01314.93
7.4.00.0090.00614.98
7.3.330.0050.00013.36
7.3.320.0000.00513.36
7.3.310.0000.00716.27
7.3.300.0000.00616.27
7.3.290.0090.00716.34
7.3.280.0090.00716.37
7.3.270.0070.01017.40
7.3.260.0060.01316.59
7.3.240.0060.01116.52
7.3.230.0130.00316.42
7.3.210.0070.01416.58
7.3.200.0090.00616.61
7.3.190.0040.01216.59
7.3.180.0100.00916.56
7.3.170.0060.00916.42
7.3.160.0000.01616.39
7.3.130.0040.01115.05
7.3.120.0020.01414.92
7.3.110.0060.00914.64
7.3.100.0030.00914.91
7.3.90.0080.00514.83
7.3.80.0050.00514.83
7.3.70.0050.00714.83
7.3.60.0050.00814.91
7.3.50.0090.00514.89
7.3.40.0060.00714.78
7.3.30.0050.00914.94
7.3.20.0060.00616.46
7.3.10.0060.00916.47
7.3.00.0040.01016.53
7.2.330.0070.01016.80
7.2.320.0030.01316.44
7.2.310.0100.00716.64
7.2.300.0070.01516.46
7.2.290.0060.01216.80
7.2.260.0060.01314.89
7.2.250.0110.00615.17
7.2.240.0080.00615.13
7.2.230.0060.00814.95
7.2.220.0030.00915.07
7.2.210.0050.00815.20
7.2.200.0050.00914.82
7.2.190.0070.00614.87
7.2.180.0050.01114.91
7.2.170.0080.00615.09
7.2.160.0110.00315.07
7.2.150.0120.00616.90
7.2.140.0030.01416.59
7.2.130.0070.00916.62
7.2.120.0080.00616.63
7.2.110.0070.00516.72
7.2.100.0060.01116.63
7.2.90.0060.00716.76
7.2.80.0050.00916.64
7.2.70.0030.01016.80
7.2.60.0050.00916.86
7.2.50.0060.00816.79
7.2.40.0050.01016.71
7.2.30.0050.00916.57
7.2.20.0080.00916.83
7.2.10.0080.00816.56
7.2.00.0060.00817.82
7.1.330.0080.00515.73
7.1.320.0020.01015.72
7.1.310.0040.00615.70
7.1.300.0070.00415.98
7.1.290.0060.00615.63
7.1.280.0050.00615.80
7.1.270.0070.00915.78
7.1.260.0050.00815.81
7.1.250.0040.00915.61
7.1.240.0090.00615.79
7.1.230.0040.00415.80
7.1.220.0090.00615.91
7.1.210.0070.00415.92
7.1.200.0020.00915.83
7.1.190.0030.01015.55
7.1.180.0060.00615.73
7.1.170.0030.00715.54
7.1.160.0040.00815.92
7.1.150.0120.00315.98
7.1.140.0040.01115.86
7.1.130.0110.00415.92
7.1.120.0000.01415.49
7.1.110.0060.00616.02
7.1.100.0040.00717.04
7.1.90.0110.00415.92
7.1.80.0030.00915.70
7.1.70.0050.00516.34
7.1.60.0050.01617.67
7.1.50.0060.00516.24
7.1.40.0030.01015.79
7.1.30.0060.01215.87
7.1.20.0070.00715.92
7.1.10.0070.00715.61
7.1.00.0050.04219.10
7.0.330.0030.00915.50
7.0.320.0060.00815.41
7.0.310.0100.00315.21
7.0.300.0030.00515.21
7.0.290.0070.00715.66
7.0.280.0070.00415.44
7.0.270.0090.00615.48
7.0.260.0030.00715.50
7.0.250.0070.00715.43
7.0.240.0100.00615.56
7.0.230.0070.00715.43
7.0.220.0030.01415.39
7.0.210.0000.01515.27
7.0.200.0240.00615.04
7.0.190.0040.00815.53
7.0.180.0030.00515.21
7.0.170.0050.00315.46
7.0.160.0070.00715.68
7.0.150.0040.00415.38
7.0.140.0130.00315.54
7.0.130.0000.01715.14
7.0.120.0110.00315.58
7.0.110.0100.00015.28
7.0.100.0070.00715.56
7.0.90.0060.00615.59
7.0.80.0040.01115.52
7.0.70.0030.01015.32
7.0.60.0170.02317.73
7.0.50.0000.04516.80
7.0.40.0020.04016.79
7.0.30.0040.03016.82
7.0.20.0180.03816.81
7.0.10.0080.04816.67
7.0.00.0050.04716.96
5.6.400.0070.01014.42
5.6.390.0000.01114.51
5.6.380.0000.00914.33
5.6.370.0000.01614.77
5.6.360.0000.01314.50
5.6.350.0030.01314.83
5.6.340.0130.00614.38
5.6.330.0110.00414.82
5.6.320.0000.00914.79
5.6.310.0040.01414.34
5.6.300.0070.01014.41
5.6.290.0030.01214.56
5.6.280.0060.04017.88
5.6.270.0040.01114.36
5.6.260.0060.00614.45
5.6.250.0110.00314.67
5.6.240.0030.01314.36
5.6.230.0060.00614.46
5.6.220.0080.00314.16
5.6.210.0060.04317.46
5.6.200.0020.02716.35
5.6.190.0050.03817.44
5.6.180.0100.03017.53
5.6.170.0190.04617.61
5.6.160.0070.02717.39
5.6.150.0060.04616.47
5.6.140.0060.02516.51
5.6.130.0100.02216.30
5.6.120.0020.02917.91
5.6.110.0050.04817.84
5.6.100.0110.03817.74
5.6.90.0040.04717.69
5.6.80.0040.02517.41
5.6.70.0060.00614.32
5.6.60.0000.01514.46
5.6.50.0000.01414.59
5.6.40.0060.00914.42
5.6.30.0090.00614.35
5.6.20.0030.01014.54
5.6.10.0060.00514.56
5.6.00.0060.00614.33
5.5.380.0080.00814.25
5.5.370.0140.00314.50
5.5.360.0100.00314.45
5.5.350.1900.02317.40
5.5.340.0070.04316.34
5.5.330.0020.03617.50
5.5.320.0180.04317.51
5.5.310.0190.03217.49
5.5.300.0080.04316.31
5.5.290.0020.03216.13
5.5.280.0080.04217.80
5.5.270.0080.04717.73
5.5.260.0060.02317.48
5.5.250.0080.04517.59
5.5.240.0070.02417.31
5.5.230.0060.00314.41
5.5.220.0100.00314.46
5.5.210.0060.00314.43
5.5.200.0070.00714.50
5.5.190.0030.00614.19
5.5.180.0120.00613.93
5.5.170.0090.00614.53
5.5.160.0030.01014.02
5.5.150.0060.00614.45
5.5.140.0060.00914.56
5.5.130.0030.01014.42
5.5.120.0030.01014.41
5.5.110.0090.00614.46
5.5.100.0070.00714.43
5.5.90.0050.00514.18
5.5.80.0050.00514.42
5.5.70.0000.01014.21
5.5.60.0040.01214.48
5.5.50.0070.00314.49
5.5.40.0070.00714.53
5.5.30.0030.01013.98
5.5.20.0090.00914.16
5.5.10.0100.00614.46
5.5.00.0060.01214.17

preferences:
53.02 ms | 401 KiB | 5 Q