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.03930.56
8.3.50.0140.04829.20
8.3.40.0100.04029.78
8.3.30.0130.03629.79
8.3.20.0100.01729.68
8.3.10.0070.01532.48
8.3.00.0100.01732.89
8.2.180.0260.03627.75
8.2.170.0070.04429.73
8.2.160.0200.02931.35
8.2.150.0100.01730.33
8.2.140.0130.01331.71
8.2.130.0070.01434.39
8.2.120.0000.02231.53
8.2.110.0170.02131.44
8.2.100.0160.02328.91
8.2.90.0130.01930.17
8.2.80.0140.02429.02
8.2.70.0110.02528.34
8.2.60.0140.02129.03
8.2.50.0100.02528.63
8.2.40.0070.02629.28
8.2.30.0160.01929.85
8.2.20.0030.02828.87
8.2.10.0070.02428.84
8.2.00.0070.02728.79
8.1.280.0310.01929.84
8.1.270.0100.01933.43
8.1.260.0070.01634.39
8.1.250.0140.01033.07
8.1.240.0040.02834.82
8.1.230.0160.02332.32
8.1.220.0140.01829.02
8.1.210.0070.02630.41
8.1.200.0070.02828.85
8.1.190.0030.03029.02
8.1.180.0130.02029.14
8.1.170.0100.02330.13
8.1.160.0070.02430.46
8.1.150.0070.02430.17
8.1.140.0000.03229.03
8.1.130.0100.02029.38
8.1.120.0000.03228.86
8.1.110.0100.02628.85
8.1.100.0040.02828.82
8.1.90.0000.03128.86
8.1.80.0030.02728.74
8.1.70.0130.01728.80
8.1.60.0100.02928.99
8.1.50.0060.03128.74
8.1.40.0030.03328.78
8.1.30.0070.03028.82
8.1.20.0100.02728.89
8.1.10.0030.03228.84
8.1.00.0100.02628.81
8.0.300.0060.02531.24
8.0.290.0040.02928.43
8.0.280.0090.02229.58
8.0.270.0100.02628.25
8.0.260.0070.02627.93
8.0.250.0070.02628.05
8.0.240.0100.02428.02
8.0.230.0090.02228.07
8.0.220.0000.03127.93
8.0.210.0130.01928.05
8.0.200.0130.01928.01
8.0.190.0110.02527.98
8.0.180.0140.02428.00
8.0.170.0070.02928.07
8.0.160.0070.03027.87
8.0.150.0060.03228.06
8.0.140.0030.04428.03
8.0.130.0100.02424.49
8.0.120.0130.02327.86
8.0.110.0070.02827.79
8.0.100.0130.02427.78
8.0.90.0030.03127.99
8.0.80.0090.04927.96
8.0.70.0000.03727.92
8.0.60.0100.02727.95
8.0.50.0000.03627.98
8.0.30.0260.03928.41
8.0.20.0240.04428.17
8.0.10.0070.02828.13
8.0.00.0160.05427.79
7.4.330.0100.02925.90
7.4.320.0090.02227.57
7.4.300.0100.01927.67
7.4.290.0000.03427.66
7.4.280.0130.02627.57
7.4.270.0060.02927.63
7.4.260.0030.02924.57
7.4.250.0180.01827.63
7.4.240.0160.02027.63
7.4.230.0100.02527.75
7.4.220.0300.03327.52
7.4.210.0200.04527.72
7.4.200.0060.02827.36
7.4.190.0030.03027.55
7.4.160.0200.03827.51
7.4.150.0120.05827.60
7.4.140.0280.05527.66
7.4.130.0220.04127.52
7.4.120.0260.04027.58
7.4.110.0320.03227.54
7.4.100.0190.04927.58
7.4.90.0130.05027.57
7.4.80.0200.05027.66
7.4.70.0190.04227.58
7.4.60.0290.03227.37
7.4.50.0100.03827.65
7.4.40.0130.03427.56
7.4.30.0260.03927.66
7.4.00.0130.03625.70
7.3.330.0040.02924.02
7.3.320.0060.02823.87
7.3.310.0030.03126.81
7.3.300.0000.03327.02
7.3.290.0190.03626.99
7.3.280.0120.06726.98
7.3.270.0130.05627.02
7.3.260.0230.06127.10
7.3.250.0200.04427.07
7.3.240.0210.07426.98
7.3.230.0220.04527.14
7.3.210.0100.05026.95
7.3.200.0320.05727.32
7.3.190.0230.06627.11
7.3.180.0200.06426.97
7.3.170.0090.05127.00
7.3.160.0100.08326.96
7.3.120.0170.03325.75
7.3.10.0090.04328.38
7.3.00.0190.03928.71
7.2.330.0200.04427.73
7.2.320.0130.05627.61
7.2.310.0350.06427.51
7.2.300.0100.05627.53
7.2.290.0160.07327.70
7.2.130.0080.04428.97
7.2.120.0100.04728.86
7.2.110.0100.04228.84
7.2.100.0140.03728.86
7.2.90.0160.03928.97
7.2.80.0250.04329.18
7.2.70.0070.04728.96
7.2.60.0100.04829.03
7.2.50.0210.04828.97
7.2.40.0020.05228.72
7.2.30.0140.04828.93
7.2.20.0050.04628.91
7.2.10.0060.05029.12
7.2.00.0070.04229.73
7.1.250.0160.03727.64
7.1.100.0900.03628.43
7.1.70.0200.02629.07
7.1.60.0130.05729.58
7.1.50.0070.05829.37
7.1.00.0000.09734.59
7.0.200.0030.03026.77
7.0.140.0100.10732.18
7.0.110.0100.09028.86
7.0.100.2970.10028.84
7.0.90.2630.10329.99
7.0.80.3270.09330.13
7.0.70.2400.11030.13
7.0.60.2470.06729.97
7.0.50.1170.10030.46
7.0.40.0130.07320.06
7.0.30.0200.06320.16
7.0.20.0100.07720.04
7.0.10.0130.10720.07
7.0.00.0130.11020.02
5.6.280.0070.17336.62
5.6.250.0100.14036.38
5.6.240.0100.10736.30
5.6.230.0170.14036.20
5.6.220.0130.16736.28
5.6.210.0070.10736.12
5.6.200.0130.15337.02
5.6.190.0170.17036.81
5.6.180.0200.14336.85
5.6.170.0100.16336.95
5.6.160.0200.16336.88
5.6.150.0130.16336.82
5.6.140.0170.16036.64
5.6.130.0170.16336.75
5.6.120.0170.13736.88
5.6.110.0200.14736.66
5.6.100.0100.16336.77
5.6.90.0100.15736.84
5.6.80.0330.14036.26
5.6.70.0270.12736.29
5.6.60.0270.13036.13
5.6.50.0200.15736.04
5.6.40.0100.16736.07
5.6.30.0100.16036.20
5.6.20.0070.13736.13
5.6.10.0070.12736.34
5.6.00.0230.14036.26
5.5.380.0170.15736.20
5.5.370.0170.16336.28
5.5.360.0130.16735.96
5.5.350.0070.18036.17
5.5.340.0070.11736.52
5.5.330.0130.15336.48
5.5.320.0230.11336.51
5.5.310.0100.15736.60
5.5.300.0200.15036.48
5.5.290.0170.14736.43
5.5.280.0000.17736.47
5.5.270.0200.14736.54
5.5.260.0170.14336.70
5.5.250.0170.15036.35
5.5.240.0230.18736.06
5.5.230.0130.14036.02
5.5.220.0200.16336.01
5.5.210.0170.15736.14
5.5.200.0170.14036.01
5.5.190.0170.15035.98
5.5.180.0070.10735.89
5.5.160.0300.11035.97
5.5.150.0170.10036.01
5.5.140.0070.10335.98
5.5.130.0070.10335.86
5.5.120.0070.11735.96
5.5.110.0170.12335.98
5.5.100.0130.10035.72
5.5.90.0100.11335.86
5.5.80.0130.10035.76
5.5.70.0130.16335.95
5.5.60.0130.16335.95
5.5.50.0030.10735.97
5.5.40.0100.11735.99
5.5.30.0000.12035.68
5.5.20.0070.11035.70
5.5.10.0270.09335.74
5.5.00.0070.10735.86
5.4.450.0170.15335.00
5.4.440.0100.17335.25
5.4.430.0170.15735.18
5.4.420.0170.15035.07
5.4.410.0270.14334.81
5.4.400.0170.16035.02
5.4.390.0100.17734.62
5.4.380.0100.16334.65
5.4.370.0170.14734.58
5.4.360.0200.15034.64
5.4.350.0170.12334.63
5.4.340.0170.16334.63
5.4.320.0130.10034.66
5.4.310.0170.09734.73
5.4.300.0170.10034.83
5.4.290.0200.09734.71
5.4.280.0070.10734.61
5.4.270.0100.10034.67
5.4.260.0100.11335.01
5.4.250.0030.11334.64
5.4.240.0030.15034.61
5.4.230.0100.09734.61
5.4.220.0100.12034.76
5.4.210.0100.11034.91
5.4.200.0130.12034.71
5.4.190.0100.10034.68
5.4.180.0070.10034.82
5.4.170.0130.11034.78
5.4.160.0130.09334.63
5.4.150.0070.11334.59
5.4.140.0170.10032.21
5.4.130.0170.16031.95
5.4.120.0200.14032.25
5.4.110.0130.15031.98
5.4.100.0200.14332.05
5.4.90.0070.15332.23
5.4.80.0230.14032.17
5.4.70.0070.11732.11
5.4.60.0130.17032.11
5.4.50.0030.11732.11
5.4.40.0200.16032.16
5.4.30.0230.15331.98
5.4.20.0130.13332.09
5.4.10.0170.10732.18
5.4.00.0100.14031.60
5.3.290.0100.10330.92
5.3.280.0100.10331.03
5.3.270.0170.12331.08
5.3.260.0000.12331.35
5.3.250.0070.13031.02
5.3.240.0130.11330.98
5.3.230.0030.11030.99
5.3.220.0000.17031.06
5.3.210.0300.15030.96
5.3.200.0100.17030.98
5.3.190.0070.16731.05
5.3.180.0130.16331.04
5.3.170.0300.15330.97
5.3.160.0170.17031.04
5.3.150.0070.18030.88
5.3.140.0170.15731.82
5.3.130.0070.18331.02
5.3.120.0070.12330.80
5.3.110.0200.13030.97
5.3.100.0170.16330.51
5.3.90.0170.12730.57
5.3.80.0130.14330.30
5.3.70.0070.10330.44
5.3.60.0070.10730.49
5.3.50.0030.13730.52
5.3.40.0170.14730.24
5.3.30.0070.16030.26
5.3.20.0100.15730.10
5.3.10.0230.14030.00
5.3.00.0170.15030.04
5.2.170.0130.11327.00
5.2.160.0130.14327.00
5.2.150.0070.14026.99
5.2.140.0100.14027.14
5.2.130.0070.14326.91
5.2.120.0070.15026.93
5.2.110.0030.13327.10
5.2.100.0130.14326.95
5.2.90.0030.15327.52
5.2.80.0130.16727.03
5.2.70.0170.14726.95
5.2.60.0030.14326.88
5.2.50.0170.14726.86
5.2.40.0030.13326.85
5.2.30.0300.12726.67
5.2.20.0100.16026.83
5.2.10.0100.14026.85
5.2.00.0170.13326.67
5.1.60.0170.12028.91
5.1.50.0030.11328.82
5.1.40.0070.11328.81
5.1.30.0100.11729.17
5.1.20.0070.13329.29
5.1.10.0130.12728.87
5.1.00.0100.09028.73
5.0.50.0130.11712.58
5.0.40.0130.10712.45
5.0.30.0000.13712.29
5.0.20.0130.10712.16
5.0.10.0070.09712.15
5.0.00.0070.06012.33
4.4.90.0030.04310.00
4.4.80.0000.0239.89
4.4.70.0070.0409.95
4.4.60.0030.0309.99
4.4.50.0030.04010.06
4.4.40.0000.06310.04
4.4.30.0070.0239.89
4.4.20.0030.0479.86
4.4.10.0000.04710.16
4.4.00.0100.0579.99
4.3.110.0000.0509.89
4.3.100.0000.0439.89
4.3.90.0030.0439.85
4.3.80.0000.07010.00
4.3.70.0070.0439.85
4.3.60.0030.0479.73
4.3.50.0030.02710.00
4.3.40.0000.0709.96
4.3.30.0030.0478.63
4.3.20.0070.0478.62
4.3.10.0000.0338.49
4.3.00.0030.0278.50

preferences:
50 ms | 401 KiB | 5 Q