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,10000) 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.0100.03828.31
8.3.50.0150.04327.21
8.3.40.0240.04129.39
8.3.30.0140.03429.35
8.3.20.0100.01729.26
8.3.10.0090.01331.20
8.3.00.0070.01932.49
8.2.180.0160.03327.00
8.2.170.0230.03629.45
8.2.160.0170.03031.20
8.2.150.0100.01729.66
8.2.140.0100.01730.85
8.2.130.0070.01432.32
8.2.120.0070.01431.29
8.2.110.0230.02631.11
8.2.100.0160.02328.53
8.2.90.0070.02629.88
8.2.80.0100.02228.25
8.2.70.0130.02428.24
8.2.60.0060.02628.55
8.2.50.0130.02628.36
8.2.40.0130.01928.97
8.2.30.0070.02530.80
8.2.20.0030.02828.41
8.2.10.0030.02828.36
8.2.00.0130.02028.33
8.1.280.0290.04628.64
8.1.270.0070.02133.19
8.1.260.0170.03030.00
8.1.250.0030.01834.04
8.1.240.0100.02434.86
8.1.230.0030.03532.11
8.1.220.0030.02728.91
8.1.210.0070.02730.08
8.1.200.0120.02228.35
8.1.190.0060.02628.55
8.1.180.0000.03228.75
8.1.170.0100.02329.56
8.1.160.0070.02430.13
8.1.150.0090.02229.75
8.1.140.0070.02528.65
8.1.130.0070.02229.04
8.1.120.0060.02428.68
8.1.110.0030.02728.70
8.1.100.0000.03128.57
8.1.90.0100.02228.63
8.1.80.0140.01728.62
8.1.70.0030.02728.65
8.1.60.0100.02728.80
8.1.50.0040.03228.68
8.1.40.0040.03228.72
8.1.30.0070.02828.80
8.1.20.0030.03228.70
8.1.10.0070.03028.64
8.1.00.0070.03428.69
8.0.300.0070.02630.73
8.0.290.0160.01628.05
8.0.280.0030.02929.42
8.0.270.0100.02328.20
8.0.260.0030.02827.77
8.0.250.0130.01927.85
8.0.240.0000.03427.86
8.0.230.0110.02127.90
8.0.220.0000.03127.73
8.0.210.0070.02727.77
8.0.200.0130.02027.89
8.0.190.0070.02827.89
8.0.180.0030.03127.93
8.0.170.0100.02627.75
8.0.160.0100.02627.91
8.0.150.0040.03227.69
8.0.140.0060.03227.86
8.0.130.0070.02724.32
8.0.120.0100.02627.80
8.0.110.0090.02527.79
8.0.100.0100.02427.77
8.0.90.0000.03427.71
8.0.80.0100.04327.85
8.0.70.0040.03227.66
8.0.60.0070.02827.62
8.0.50.0070.02927.81
8.0.30.0310.03327.97
8.0.20.0260.03928.04
8.0.10.0100.02628.01
8.0.00.0090.05427.79
7.4.330.0060.01926.92
7.4.320.0030.02727.32
7.4.300.0060.02327.54
7.4.290.0130.02027.46
7.4.280.0140.02127.39
7.4.270.0000.03527.41
7.4.260.0060.02824.21
7.4.250.0100.02527.26
7.4.240.0180.01827.38
7.4.230.0090.02527.60
7.4.220.0100.06027.30
7.4.210.0170.03927.47
7.4.200.0100.02427.43
7.4.190.0070.03627.65
7.4.160.0190.04927.32
7.4.150.0120.06327.52
7.4.140.0150.05027.41
7.4.130.0170.05627.50
7.4.120.0170.04627.38
7.4.110.0190.04527.50
7.4.100.0200.04727.59
7.4.90.0270.07627.38
7.4.80.0160.04527.50
7.4.70.0230.04627.32
7.4.60.0230.03927.36
7.4.50.0130.03327.48
7.4.40.0130.03627.48
7.4.30.0190.04227.32
7.4.00.0130.04025.61
7.3.330.0040.02823.55
7.3.320.0000.03223.64
7.3.310.0030.03026.52
7.3.300.0100.02426.43
7.3.290.0170.04126.59
7.3.280.0210.06626.53
7.3.270.0230.04026.92
7.3.260.0180.05526.62
7.3.250.0190.04526.76
7.3.240.0160.04626.96
7.3.230.0160.04626.71
7.3.210.0130.06426.75
7.3.200.0190.05126.50
7.3.190.0200.06826.85
7.3.180.0190.03926.76
7.3.170.0190.07426.62
7.3.160.0170.04426.64
7.3.120.0170.03425.19
7.2.330.0220.04527.31
7.2.320.0380.05527.27
7.2.310.0130.06027.00
7.2.300.0210.04827.27
7.2.290.0250.03527.21
7.1.70.0030.03627.43
7.1.60.0270.02427.27
7.1.50.0160.05227.34
7.1.00.0070.05332.61
7.0.200.0100.03624.76
7.0.140.0130.10029.95
7.0.90.2070.06329.88
7.0.80.2200.06729.79
7.0.70.2130.11329.79
7.0.60.2270.09029.80
7.0.50.2070.10330.11
7.0.40.0130.10720.00
7.0.30.0100.06720.05
7.0.20.0070.06020.05
7.0.10.0030.07320.14
7.0.00.0170.10320.12
5.6.280.0100.16336.54
5.6.240.0130.16736.00
5.6.230.0170.12336.04
5.6.220.0130.09736.08
5.6.210.0070.14035.96
5.6.200.0200.13336.38
5.6.190.0100.14336.43
5.6.180.0070.10336.41
5.6.170.0070.09736.46
5.6.160.0130.12736.51
5.6.150.0100.14736.44
5.6.140.0130.16336.34
5.6.130.0070.10336.48
5.6.120.0100.10336.45
5.6.110.0130.09736.42
5.6.100.0070.16336.42
5.6.90.0030.11336.44
5.6.80.0030.10735.82
5.6.70.0070.10035.80
5.6.60.0170.09335.91
5.6.50.0000.11035.84
5.6.40.0070.11035.79
5.6.30.0030.11035.83
5.6.20.0130.15335.87
5.6.10.0030.12035.73
5.6.00.0130.14335.82
5.5.380.0170.14035.92
5.5.370.0170.15335.83
5.5.360.0130.10335.75
5.5.350.0230.14335.75
5.5.340.0130.15736.21
5.5.330.0100.12336.24
5.5.320.0100.13336.19
5.5.310.0000.15036.28
5.5.300.0200.13736.32
5.5.290.0100.15736.21
5.5.280.0100.15736.23
5.5.270.0130.14336.30
5.5.260.0100.11336.26
5.5.250.0130.17335.95
5.5.240.0230.13735.40
5.5.230.0070.11035.72
5.5.220.0200.14035.61
5.5.210.0130.15335.63
5.5.200.0130.10035.65
5.5.190.0270.15735.59
5.5.180.0200.16735.67
5.5.160.0100.17735.40
5.5.150.0130.13335.40
5.5.140.0170.15335.64
5.5.130.0170.10335.64
5.5.120.0070.17335.56
5.5.110.0100.14335.66
5.5.100.0130.09035.43
5.5.90.0130.10035.36
5.5.80.0030.11035.36
5.5.70.0100.14335.47
5.5.60.0070.10335.57
5.5.50.0070.09335.56
5.5.40.0030.13035.34
5.5.30.0170.09735.55
5.5.20.0100.10035.46
5.5.10.0170.13335.38
5.5.00.0230.08335.48
5.4.450.0100.18034.86
5.4.440.0030.16034.70
5.4.430.0070.13334.68
5.4.420.0130.15034.53
5.4.410.0030.11334.56
5.4.400.0170.15734.52
5.4.390.0200.13734.46
5.4.380.0100.11334.34
5.4.370.0100.10734.40
5.4.360.0200.16334.44
5.4.350.0100.10334.37
5.4.340.0100.14034.40
5.4.320.0070.15034.41
5.4.310.0070.13334.25
5.4.300.0170.11334.23
5.4.290.0070.10734.23
5.4.280.0070.09734.52
5.4.270.0100.15034.45
5.4.260.0170.16334.50
5.4.250.0100.15334.37
5.4.240.0200.09034.33
5.4.230.0030.10734.37
5.4.220.0130.10334.36
5.4.210.0170.09334.19
5.4.200.0100.09034.27
5.4.190.0030.12034.37
5.4.180.0030.10334.55
5.4.170.0070.10334.32
5.4.160.0000.11734.36
5.4.150.0230.09034.35
5.4.140.0070.10331.81
5.4.130.0170.10731.75
5.4.120.0170.13031.53
5.4.110.0200.08731.70
5.4.100.0130.09731.66
5.4.90.0130.09331.88
5.4.80.0030.10331.79
5.4.70.0000.12331.85
5.4.60.0030.10731.74
5.4.50.0100.12031.67
5.4.40.0100.14731.70
5.4.30.0030.11731.97
5.4.20.0100.16731.68
5.4.10.0030.14731.71
5.4.00.0070.14331.27
5.3.290.0100.13030.66
5.3.280.0070.11030.64
5.3.270.0130.10030.61
5.3.260.0070.11030.65
5.3.250.0030.11330.78
5.3.240.0100.12030.78
5.3.230.0100.11030.60
5.3.220.0100.14030.72
5.3.210.0030.11030.63
5.3.200.0200.09330.57
5.3.190.0070.15030.70
5.3.180.0100.09330.56
5.3.170.0030.11030.64
5.3.160.0130.14030.72
5.3.150.0070.10730.61
5.3.140.0070.13030.78
5.3.130.0100.17030.71
5.3.120.0070.17330.52
5.3.110.0100.10730.56
5.3.100.0200.16030.04
5.3.90.0130.10030.10
5.3.80.0170.13030.12
5.3.70.0100.13030.03
5.3.60.0030.11030.02
5.3.50.0130.15029.94
5.3.40.0130.14330.01
5.3.30.0130.10029.93
5.3.20.0070.10729.68
5.3.10.0030.11029.74
5.3.00.0200.14329.77
5.2.170.0230.14026.60
5.2.160.0070.16326.67
5.2.150.0000.16726.56
5.2.140.0070.15326.61
5.2.130.0070.12726.52
5.2.120.0070.13326.51
5.2.110.0100.14326.37
5.2.100.0070.14326.62
5.2.90.0170.15326.52
5.2.80.0070.15026.45
5.2.70.0130.15026.68
5.2.60.0030.17726.48
5.2.50.0170.16326.55
5.2.40.0100.16326.44
5.2.30.0070.15726.42
5.2.20.0030.11026.33
5.2.10.0100.14726.23
5.2.00.0130.16026.23
5.1.60.0130.12328.87
5.1.50.0030.10728.92
5.1.40.0100.12328.89
5.1.30.0200.12329.02
5.1.20.0070.12729.33
5.1.10.0200.08728.80
5.1.00.0030.10028.89
5.0.50.0030.11312.53
5.0.40.0000.10012.35
5.0.30.0000.12712.26
5.0.20.0100.12312.25
5.0.10.0030.10712.21
5.0.00.0100.06012.00
4.4.90.0000.0479.92
4.4.80.0130.0339.91
4.4.70.0030.0409.96
4.4.60.0070.0379.93
4.4.50.0000.0309.93
4.4.40.0030.03710.01
4.4.30.0070.04010.04
4.4.20.0000.04710.07
4.4.10.0030.0209.97
4.4.00.0000.0709.96
4.3.110.0070.0439.97
4.3.100.0030.0439.97
4.3.90.0070.0279.87
4.3.80.0070.0609.92
4.3.70.0030.0279.84
4.3.60.0030.0509.90
4.3.50.0030.0439.94
4.3.40.0000.0409.79
4.3.30.0030.0208.59
4.3.20.0030.0478.65
4.3.10.0070.0378.54
4.3.00.0070.0338.61

preferences:
40.65 ms | 401 KiB | 5 Q