3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array=array("number"=>"3","string"=>"abc","null"=>null); $ncache=array(); $scache=array(); foreach(range(1,80) as $it) { $ncache[]=$array; $scache[]=$array; } function ncompress(&$v) { if(is_numeric($v)) $v=floatval($v); elseif(is_string($v)) $v=trim($v); elseif(is_null($v)) $v=null; } function scompress(&$v) { if(is_numeric($v)) $v=floatval($v); elseif(is_string($v)) $v=trim($v); elseif(is_null($v)) $v=""; } array_walk_recursive($ncache,"ncompress"); array_walk_recursive($scache,"scompress"); echo "Length of null : ".strlen(json_encode($ncache)).' ('.strlen(gzdeflate(json_encode($ncache))).')'; echo "\n"; echo "Length of string: ".strlen(json_encode($scache)).' ('.strlen(gzdeflate(json_encode($scache))).')';

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.0070.01116.74
8.3.50.0120.00422.01
8.3.40.0000.01519.09
8.3.30.0040.01119.38
8.3.20.0050.00220.59
8.3.10.0040.00423.64
8.3.00.0040.00419.01
8.2.180.0130.00318.21
8.2.170.0090.00622.96
8.2.160.0100.01020.66
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0040.00422.31
8.2.110.0060.00322.09
8.2.100.0080.00418.16
8.2.90.0040.00419.65
8.2.80.0030.00518.04
8.2.70.0080.00017.88
8.2.60.0030.00518.28
8.2.50.0060.00318.07
8.2.40.0070.00718.28
8.2.30.0040.00418.43
8.2.20.0040.00418.10
8.2.10.0080.00318.54
8.2.00.0080.00318.04
8.1.280.0100.01025.92
8.1.270.0080.00023.75
8.1.260.0000.00826.35
8.1.250.0050.00328.09
8.1.240.0040.00424.01
8.1.230.0040.00819.39
8.1.220.0030.00517.93
8.1.210.0040.00418.77
8.1.200.0040.00417.60
8.1.190.0060.00317.80
8.1.180.0060.00318.10
8.1.170.0050.00418.89
8.1.160.0080.00022.27
8.1.150.0030.00518.90
8.1.140.0040.00417.70
8.1.130.0050.00317.97
8.1.120.0070.00017.64
8.1.110.0040.00417.68
8.1.100.0000.00817.73
8.1.90.0050.00317.66
8.1.80.0030.00717.61
8.1.70.0040.00417.68
8.1.60.0060.00617.80
8.1.50.0050.00317.72
8.1.40.0040.00417.67
8.1.30.0000.00817.78
8.1.20.0040.00417.76
8.1.10.0050.00317.67
8.1.00.0030.00617.60
8.0.300.0040.00419.20
8.0.290.0050.00217.43
8.0.280.0040.00418.73
8.0.270.0000.00717.52
8.0.260.0040.00417.46
8.0.250.0070.00017.27
8.0.240.0070.00017.29
8.0.230.0070.00017.19
8.0.220.0000.00717.20
8.0.210.0000.00717.11
8.0.200.0000.00717.13
8.0.190.0060.00317.21
8.0.180.0000.00817.23
8.0.170.0030.00617.20
8.0.160.0080.00017.22
8.0.150.0040.00417.02
8.0.140.0050.00217.18
8.0.130.0060.00013.56
8.0.120.0080.00017.07
8.0.110.0030.00517.07
8.0.100.0030.00617.24
8.0.90.0070.00017.30
8.0.80.0030.01217.15
8.0.70.0070.00017.17
8.0.60.0040.00417.20
8.0.50.0030.00517.21
8.0.30.0100.01017.53
8.0.20.0120.00717.45
8.0.10.0050.00217.18
8.0.00.0110.01016.91
7.4.330.0000.00515.00
7.4.320.0000.00716.80
7.4.300.0030.00316.91
7.4.290.0090.00016.79
7.4.280.0000.00816.93
7.4.270.0040.00416.87
7.4.260.0000.00716.90
7.4.250.0050.00316.83
7.4.240.0020.00516.79
7.4.230.0070.00016.63
7.4.220.0120.00616.90
7.4.210.0080.00616.92
7.4.200.0000.00816.77
7.4.190.0040.00416.93
7.4.160.0080.00816.63
7.4.150.0030.01517.40
7.4.140.0090.01017.86
7.4.130.0100.00716.72
7.4.120.0070.01116.85
7.4.110.0100.01316.84
7.4.100.0040.01516.84
7.4.90.0100.00616.63
7.4.80.0100.01319.39
7.4.70.0060.01016.70
7.4.60.0030.01616.79
7.4.50.0000.00816.88
7.4.40.0080.00822.77
7.4.30.0120.00616.83
7.4.00.0100.00715.45
7.3.330.0030.00313.57
7.3.320.0000.00513.54
7.3.310.0050.00216.56
7.3.300.0070.00016.53
7.3.290.0050.01016.57
7.3.280.0080.00916.58
7.3.270.0140.00417.40
7.3.260.0090.00916.61
7.3.250.0130.00616.77
7.3.240.0060.01216.82
7.3.230.0130.01016.55
7.3.210.0120.00616.80
7.3.200.0160.00919.39
7.3.190.0090.00916.90
7.3.180.0030.01316.60
7.3.170.0120.00516.61
7.3.160.0100.00716.73
7.3.120.0100.00714.98
7.3.10.0070.00716.35
7.3.00.0030.01416.63
7.2.330.0100.00717.07
7.2.320.0130.00716.98
7.2.310.0070.01116.86
7.2.300.0100.00617.02
7.2.290.0100.01317.14
7.2.130.0030.01216.83
7.2.120.0040.01517.12
7.2.110.0030.01016.77
7.2.100.0120.00316.80
7.2.90.0000.01317.16
7.2.80.0060.00917.06
7.2.70.0130.00317.05
7.2.60.0030.01216.76
7.2.50.0080.00516.83
7.2.40.0080.00416.77
7.2.30.0080.00317.09
7.2.20.0060.01017.16
7.2.10.0060.00916.91
7.2.00.0070.00518.33
7.1.250.0030.01015.83
7.1.100.0000.01818.42
7.1.70.0000.00817.17
7.1.60.0040.01519.46
7.1.50.0100.01416.59
7.1.00.0030.07322.42
7.0.200.0000.00916.55
7.0.140.0000.07721.95
7.0.90.0770.07320.12
7.0.80.0700.07320.16
7.0.70.0630.07720.24
7.0.60.0070.08020.14
7.0.50.0470.07020.50
7.0.40.0100.07720.13
7.0.30.0170.07720.05
7.0.20.0100.08019.96
7.0.10.0070.07020.07
7.0.00.0030.07720.09
5.6.280.0000.08021.44
5.6.240.0130.07320.96
5.6.230.0100.08721.02
5.6.220.0100.07720.89
5.6.210.0030.04321.00
5.6.200.0070.07021.29
5.6.190.0100.08321.33
5.6.180.0030.07321.38
5.6.170.0000.07721.27
5.6.160.0070.08721.32
5.6.150.0200.04721.30
5.6.140.0130.03721.37
5.6.130.0100.07321.48
5.6.120.0000.09721.31
5.6.110.0070.08021.31
5.6.100.0070.08721.43
5.6.90.0070.08021.26
5.6.80.0100.07320.75
5.6.70.0000.08320.75
5.6.60.0070.04720.80
5.6.50.0070.07720.73
5.6.40.0170.07320.69
5.6.30.0100.07320.63
5.6.20.0070.08020.71
5.6.10.0070.07020.75
5.6.00.0100.08320.75
5.5.380.0000.07320.69
5.5.370.0030.04720.84
5.5.360.0030.06720.73
5.5.350.0100.06320.75
5.5.340.0100.07321.09
5.5.330.0030.05021.06
5.5.320.0070.05721.13
5.5.310.0100.06021.25
5.5.300.0000.05321.21
5.5.290.0170.04021.23
5.5.280.0170.07321.24
5.5.270.0130.07021.20
5.5.260.0030.09021.18
5.5.250.0070.08321.00
5.5.240.0000.09020.54
5.5.230.0070.05720.47
5.5.220.0030.05020.60
5.5.210.0070.07720.59
5.5.200.0070.07020.57
5.5.190.0030.08320.55
5.5.180.0130.07020.59
5.5.160.0070.05320.45
5.5.150.0130.07320.43
5.5.140.0030.08320.53
5.5.130.0130.07020.41
5.5.120.0100.08720.59
5.5.110.0130.06720.58
5.5.100.0030.07020.48
5.5.90.0070.08020.47
5.5.80.0130.06720.33
5.5.70.0070.08020.32
5.5.60.0130.04020.38
5.5.50.0030.07720.32
5.5.40.0070.03720.48
5.5.30.0070.04020.38
5.5.20.0030.07020.43
5.5.10.0100.04020.33
5.5.00.0030.04020.34
5.4.450.0100.06319.71
5.4.440.0100.07319.54
5.4.430.0070.08019.76
5.4.420.0130.07319.64
5.4.410.0070.05019.35
5.4.400.0000.06319.38
5.4.390.0030.08019.29
5.4.380.0100.07319.21
5.4.370.0130.06719.29
5.4.360.0030.08319.28
5.4.350.0070.07719.47
5.4.340.0130.07719.30
5.4.320.0070.07319.29
5.4.310.0030.08719.12
5.4.300.0100.06019.37
5.4.290.0070.05319.16
5.4.280.0070.08319.43
5.4.270.0100.07019.47
5.4.260.0070.07719.36
5.4.250.0070.03719.43
5.4.240.0030.08019.26
5.4.230.0000.09019.30
5.4.220.0030.05719.27
5.4.210.0070.03719.34
5.4.200.0000.04019.37
5.4.190.0030.04319.19
5.4.180.0070.04019.36
5.4.170.0030.08019.15
5.4.160.0070.03319.30
5.4.150.0030.04019.17
5.4.140.0000.03316.54
5.4.130.0070.03716.55
5.4.120.0000.04316.60
5.4.110.0000.04716.62
5.4.100.0000.04016.64
5.4.90.0000.04016.69
5.4.80.0000.05716.56
5.4.70.0000.04016.71
5.4.60.0070.02716.62
5.4.50.0000.03716.60
5.4.40.0000.06016.55
5.4.30.0030.03716.59
5.4.20.0000.04716.58
5.4.10.0030.04016.67
5.4.00.0070.03316.05
5.3.290.0070.08014.98
5.3.280.0000.04715.00
5.3.270.0070.04714.90
5.3.260.0000.04314.97
5.3.250.0070.04015.05
5.3.240.0000.03314.90
5.3.230.0000.05014.83
5.3.220.0070.04314.81
5.3.210.0070.03714.82
5.3.200.0070.05014.82
5.3.190.0070.05714.99
5.3.180.0030.06014.90
5.3.170.0100.06314.97
5.3.160.0000.03714.93
5.3.150.0030.03714.80
5.3.140.0030.08015.00
5.3.130.0000.03714.79
5.3.120.0000.04014.97
5.3.110.0100.03014.98
5.3.100.0030.05714.40
5.3.90.0130.03714.44
5.3.80.0070.03014.31
5.3.70.0100.03714.31
5.3.60.0000.05014.41
5.3.50.0000.04314.37
5.3.40.0000.04014.30
5.3.30.0030.03714.27
5.3.20.0070.02714.05
5.3.10.0070.02714.02
5.3.00.0070.03314.05
5.2.170.0000.03011.56
5.2.160.0000.03311.54
5.2.150.0000.03011.53
5.2.140.0000.03311.45
5.2.130.0000.03011.41
5.2.120.0000.03311.51
5.2.110.0000.03011.39
5.2.100.0000.03011.40
5.2.90.0000.04011.40
5.2.80.0030.03011.49
5.2.70.0070.02711.49
5.2.60.0030.02711.21
5.2.50.0070.03711.05
5.2.40.0030.04311.10
5.2.30.0030.03711.00
5.2.20.0030.02711.18
5.2.10.0070.03011.16
5.2.00.0000.03711.14
5.1.60.0070.02710.21
5.1.50.0000.02310.23
5.1.40.0000.03310.21
5.1.30.0030.02710.36
5.1.20.0030.02010.51
5.1.10.0030.03010.33
5.1.00.0000.04010.28
5.0.50.0000.0208.59
5.0.40.0000.0238.48
5.0.30.0000.0308.15
5.0.20.0000.0208.32
5.0.10.0000.0178.27
5.0.00.0000.0308.07
4.4.90.0030.0207.24
4.4.80.0000.0207.24
4.4.70.0000.0177.24
4.4.60.0000.0207.24
4.4.50.0030.0137.24
4.4.40.0000.0407.24
4.4.30.0000.0237.24
4.4.20.0000.0137.24
4.4.10.0030.0307.24
4.4.00.0000.0337.24
4.3.110.0000.0137.24
4.3.100.0000.0137.24
4.3.90.0000.0177.24
4.3.80.0070.0177.24
4.3.70.0030.0137.24
4.3.60.0070.0277.24
4.3.50.0030.0177.24
4.3.40.0070.0477.24
4.3.30.0000.0277.24
4.3.20.0000.0377.24
4.3.10.0000.0377.24
4.3.00.0030.0337.24

preferences:
79.1 ms | 401 KiB | 5 Q