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.0200.03727.93
8.3.50.0240.03327.77
8.3.40.0230.03729.42
8.3.30.0160.03329.29
8.3.20.0030.02329.27
8.3.10.0000.02230.47
8.3.00.0100.01632.66
8.2.180.0200.04327.38
8.2.170.0240.02429.38
8.2.160.0170.03030.97
8.2.150.0100.01629.47
8.2.140.0170.01731.03
8.2.130.0070.01432.43
8.2.120.0130.01628.86
8.2.110.0100.02930.07
8.2.100.0100.03028.41
8.2.90.0110.02129.96
8.2.80.0100.02228.55
8.2.70.0100.02428.38
8.2.60.0030.02830.09
8.2.50.0040.02828.84
8.2.40.0030.03031.08
8.2.30.0100.02430.09
8.2.20.0070.02428.45
8.2.10.0060.02528.36
8.2.00.0070.02728.50
8.1.280.0310.03128.75
8.1.270.0100.01733.38
8.1.260.0060.01634.49
8.1.250.0100.01632.68
8.1.240.0070.02631.58
8.1.230.0110.02830.27
8.1.220.0060.02528.78
8.1.210.0090.02228.36
8.1.200.0090.02528.60
8.1.190.0060.02628.47
8.1.180.0120.01928.66
8.1.170.0130.02029.68
8.1.160.0030.02730.04
8.1.150.0070.02531.46
8.1.140.0070.02428.70
8.1.130.0070.02528.72
8.1.120.0090.02228.58
8.1.110.0130.01928.64
8.1.100.0070.02328.62
8.1.90.0070.02328.61
8.1.80.0060.02528.52
8.1.70.0060.02628.57
8.1.60.0060.03228.76
8.1.50.0100.02428.71
8.1.40.0100.02628.62
8.1.30.0100.02628.75
8.1.20.0030.03328.79
8.1.10.0100.02628.78
8.1.00.0070.03028.61
8.0.300.0060.02527.69
8.0.290.0120.02127.63
8.0.280.0070.02529.44
8.0.270.0100.02328.31
8.0.260.0100.02027.75
8.0.250.0110.02527.89
8.0.240.0100.03827.93
8.0.230.0070.02427.81
8.0.220.0000.03127.75
8.0.210.0130.01927.84
8.0.200.0060.02927.79
8.0.190.0030.03427.90
8.0.180.0090.02527.86
8.0.170.0070.02927.75
8.0.160.0030.03427.91
8.0.150.0130.04027.70
8.0.140.0100.03127.80
8.0.130.0100.03724.37
8.0.120.0070.02827.70
8.0.110.0030.03127.73
8.0.100.0100.02627.63
8.0.90.0100.03027.64
8.0.80.0160.04427.82
8.0.70.0130.02327.64
8.0.60.0000.03927.63
8.0.50.0030.03127.85
8.0.30.0210.05727.98
8.0.20.0190.04627.91
8.0.10.0030.03227.85
8.0.00.0200.06027.69
7.4.330.0030.02224.86
7.4.320.0000.03027.51
7.4.300.0060.02227.38
7.4.290.0130.02227.37
7.4.280.0130.02327.51
7.4.270.0030.03327.50
7.4.260.0130.02024.27
7.4.250.0030.03427.38
7.4.240.0000.03927.46
7.4.230.0090.02527.13
7.4.220.0230.05227.39
7.4.210.0200.04627.45
7.4.200.0060.02827.37
7.4.190.0130.02327.36
7.4.160.0160.04227.48
7.4.150.0210.08227.33
7.4.140.0240.05627.51
7.4.130.0220.04527.33
7.4.120.0200.04127.47
7.4.110.0260.03627.42
7.4.100.0170.04727.46
7.4.90.0220.07327.46
7.4.80.0370.04127.37
7.4.70.0150.04627.25
7.4.60.0220.04127.38
7.4.50.0100.03727.38
7.4.40.0130.04627.39
7.4.30.0100.06327.43
7.4.00.0100.04125.97
7.3.330.0040.02923.61
7.3.320.0040.02923.60
7.3.310.0130.02226.55
7.3.300.0140.02426.51
7.3.290.0030.05326.56
7.3.280.0160.05726.56
7.3.270.0040.05826.69
7.3.260.0190.05826.81
7.3.250.0240.06726.84
7.3.240.0170.05326.84
7.3.230.0400.04326.93
7.3.210.0130.04826.84
7.3.200.0280.04926.73
7.3.190.0250.03526.60
7.3.180.0340.05126.72
7.3.170.0190.04226.52
7.3.160.0100.04726.64
7.3.120.0190.02925.34
7.2.330.0230.04227.28
7.2.320.0030.06427.35
7.2.310.0070.06227.44
7.2.300.0120.05627.18
7.2.290.0160.04727.41
7.2.00.0200.03029.29
7.1.200.0070.04425.95
7.1.100.0570.02327.28
7.1.70.0130.02727.44
7.1.60.0130.02327.64
7.1.50.0030.06427.18
7.1.00.0030.08732.64
7.0.200.2480.03723.88
7.0.140.0100.10729.93
7.0.90.0170.06329.75
7.0.80.1170.06329.75
7.0.70.2000.10729.82
7.0.60.0030.11329.91
7.0.50.2270.09330.21
7.0.40.0070.12320.18
7.0.30.0030.08720.11
7.0.20.0070.06720.00
7.0.10.0070.08020.08
7.0.00.0030.10720.07
5.6.280.0070.17336.33
5.6.240.0000.12036.05
5.6.230.0100.08336.00
5.6.220.0130.14336.10
5.6.210.0100.15336.18
5.6.200.0130.12036.45
5.6.190.0100.17736.37
5.6.180.0130.10036.58
5.6.170.0130.13336.47
5.6.160.0130.10036.43
5.6.150.0070.15036.45
5.6.140.0070.13736.37
5.6.130.0170.15736.64
5.6.120.0170.12336.43
5.6.110.0070.15736.73
5.6.100.0200.10336.57
5.6.90.0030.14036.49
5.6.80.0000.16735.93
5.6.70.0100.11335.81
5.6.60.0170.15735.80
5.6.50.0070.13035.84
5.6.40.0100.14735.79
5.6.30.0100.14735.75
5.6.20.0100.15335.84
5.6.10.0070.13335.84
5.6.00.0130.14035.75
5.5.380.0200.10735.80
5.5.370.0130.08335.97
5.5.360.0100.17335.90
5.5.350.0030.15735.85
5.5.340.0030.14736.21
5.5.330.0130.12336.21
5.5.320.0200.14336.18
5.5.310.0100.10736.28
5.5.300.0100.11036.20
5.5.290.0100.13736.18
5.5.280.0170.14736.27
5.5.270.0030.11036.20
5.5.260.0200.14036.16
5.5.250.0070.14036.00
5.5.240.0170.15735.53
5.5.230.0070.15335.78
5.5.220.0230.13735.54
5.5.210.0100.10335.71
5.5.200.0170.11335.52
5.5.190.0000.13735.69
5.5.180.0170.15035.69
5.5.160.0270.15035.56
5.5.150.0100.12035.40
5.5.140.0030.10735.58
5.5.130.0130.16035.39
5.5.120.0030.11335.57
5.5.110.0170.09735.55
5.5.100.0030.17735.48
5.5.90.0200.14335.56
5.5.80.0200.09335.36
5.5.70.0100.16335.45
5.5.60.0170.17035.53
5.5.50.0170.13035.56
5.5.40.0100.11335.47
5.5.30.0170.15035.52
5.5.20.0230.13335.34
5.5.10.0130.17735.53
5.5.00.0170.14735.53
5.4.450.0070.16734.58
5.4.440.0270.15334.63
5.4.430.0000.11334.72
5.4.420.0070.16334.55
5.4.410.0170.10034.50
5.4.400.0070.15334.56
5.4.390.0130.13734.29
5.4.380.0070.17034.43
5.4.370.0000.17334.44
5.4.360.0070.14334.37
5.4.350.0170.15334.20
5.4.340.0270.13034.41
5.4.320.0130.17034.37
5.4.310.0130.15334.30
5.4.300.0370.14334.55
5.4.290.0270.16334.52
5.4.280.0070.15034.37
5.4.270.0100.14734.65
5.4.260.0100.16734.52
5.4.250.0070.13734.44
5.4.240.0100.17034.36
5.4.230.0170.16334.51
5.4.220.0100.11734.39
5.4.210.0100.11334.36
5.4.200.0100.16034.37
5.4.190.0070.15334.20
5.4.180.0100.15334.37
5.4.170.0230.15334.39
5.4.160.0070.16334.50
5.4.150.0170.13734.36
5.4.140.0170.13031.77
5.4.130.0100.16031.74
5.4.120.0170.09331.66
5.4.110.0000.12731.84
5.4.100.0130.14731.72
5.4.90.0170.10731.88
5.4.80.0100.15031.82
5.4.70.0130.14731.69
5.4.60.0230.13031.68
5.4.50.0230.14031.70
5.4.40.0100.10331.78
5.4.30.0100.16731.66
5.4.20.0030.10331.71
5.4.10.0200.14331.71
5.4.00.0070.11331.19
5.3.290.0200.13030.76
5.3.280.0100.15730.74
5.3.270.0170.14030.78
5.3.260.0070.17730.59
5.3.250.0130.12030.79
5.3.240.0070.15330.62
5.3.230.0100.16330.71
5.3.220.0030.11330.68
5.3.210.0130.10330.58
5.3.200.0130.14730.68
5.3.190.0070.12030.79
5.3.180.0100.16730.72
5.3.170.0130.10030.65
5.3.160.0200.13330.61
5.3.150.0230.14330.73
5.3.140.0130.12330.61
5.3.130.0100.17330.72
5.3.120.0070.12730.73
5.3.110.0170.09030.59
5.3.100.0100.12030.17
5.3.90.0130.15030.22
5.3.80.0170.16730.01
5.3.70.0100.16030.05
5.3.60.0100.10729.95
5.3.50.0170.15329.94
5.3.40.0100.15030.11
5.3.30.0130.10329.93
5.3.20.0070.11029.63
5.3.10.0170.16729.69
5.3.00.0070.11029.72
5.2.170.0170.16326.45
5.2.160.0130.13026.73
5.2.150.0130.10326.68
5.2.140.0100.15026.65
5.2.130.0000.11326.46
5.2.120.0030.13326.46
5.2.110.0100.13726.46
5.2.100.0130.09726.41
5.2.90.0130.15726.55
5.2.80.0130.12726.60
5.2.70.0100.12026.55
5.2.60.0170.12026.51
5.2.50.0070.13026.49
5.2.40.0100.17026.44
5.2.30.0170.11726.41
5.2.20.0130.13026.52
5.2.10.0130.12326.38
5.2.00.0170.12326.38
5.1.60.0100.09728.90
5.1.50.0200.08328.78
5.1.40.0130.07328.94
5.1.30.0070.07729.07
5.1.20.0130.06029.05
5.1.10.0170.11028.94
5.1.00.0170.06728.98
5.0.50.0000.12012.68
5.0.40.0070.06012.43
5.0.30.0070.08312.17
5.0.20.0000.13012.05
5.0.10.0070.08712.15
5.0.00.0000.04012.09
4.4.90.0000.03010.02
4.4.80.0030.0309.92
4.4.70.0100.0379.90
4.4.60.0030.0539.92
4.4.50.0070.03710.01
4.4.40.0000.06010.04
4.4.30.0030.0309.98
4.4.20.0100.0179.99
4.4.10.0000.04710.00
4.4.00.0030.03710.07
4.3.110.0000.0279.87
4.3.100.0000.0279.86
4.3.90.0000.0439.94
4.3.80.0030.0379.84
4.3.70.0070.0409.88
4.3.60.0030.0309.83
4.3.50.0030.0479.90
4.3.40.0030.0609.77
4.3.30.0070.0278.61
4.3.20.0070.0478.65
4.3.10.0030.0508.54
4.3.00.0070.0438.64

preferences:
55.77 ms | 401 KiB | 5 Q