3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr=array( array("count"=>10,"date"=>"2014-04-16"), array("count"=>50,"date"=>"2014-04-18"), array("count"=>80,"date"=>"2014-04-20") ); $date =array("2014-04-16","2014-04-17","2014-04-18","2014-04-19","2014-04-20"); foreach($arr as $k =>$v ){ //if(!array_key_exists($v['date'],$date)){ // $arr[]=array("count"=>0,"date"=>$date) //} $new[$v['date']]=$v;//["count"]; }print_r($new); //print_r(array_combine($date,$new)); //foreach($new as $k =>$v){ foreach($date as $k2 =>$v2 ){ if(!array_key_exists($v2,$new)){$new[$v2]["count"]=0;} }print_r($new);die; //} foreach ($new as $k => $v){ $data[]=array("count"=>$v,"date"=>$k); } /*foreach($arr as $k2 =>$v2 ){foreach($date as $k =>$v ){ if(!array_key_exists($v,$tt)){ $arr[]=array("count"=>0,"date"=>$v); } } }*/ usort($data, function($a, $b) { if($a['date'] == $b['date']) return 0; return $a['date'] > $b['date'] ? 1 : -1; }); print_r($data);die; //对应$date所有日期转换为 $arr=array( array("count"=>10,"date"=>"2014-04-16"), array("count"=>0,"date"=>"2014-04-17"), array("count"=>50,"date"=>"2014-04-18"), array("count"=>0,"date"=>"2014-04-19"), array("count"=>80,"date"=>"2014-04-20") );

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.0210.00016.88
8.3.50.0090.00916.45
8.3.40.0120.00319.09
8.3.30.0120.00318.82
8.3.20.0100.00618.73
8.3.10.0000.00820.71
8.3.00.0040.00419.27
8.2.180.0070.01417.00
8.2.170.0120.00422.96
8.2.160.0080.01320.53
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0030.00526.16
8.2.120.0100.00017.63
8.2.110.0090.00020.82
8.2.100.0110.00017.91
8.2.90.0070.00420.95
8.2.80.0040.00418.03
8.2.70.0090.00317.63
8.2.60.0030.00717.93
8.2.50.0060.00318.07
8.2.40.0000.00718.34
8.2.30.0040.00418.13
8.2.20.0040.00417.79
8.2.10.0070.00017.70
8.2.00.0000.00917.73
8.1.280.0070.01125.92
8.1.270.0090.00624.66
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0090.00320.81
8.1.230.0060.00620.79
8.1.220.0040.00417.74
8.1.210.0000.00818.95
8.1.200.0090.00017.34
8.1.190.0000.00817.53
8.1.180.0040.00418.10
8.1.170.0040.00418.89
8.1.160.0070.00018.88
8.1.150.0050.00218.58
8.1.140.0040.00417.48
8.1.130.0060.00317.91
8.1.120.0040.00417.42
8.1.110.0000.00717.33
8.1.100.0040.00417.48
8.1.90.0030.00717.49
8.1.80.0030.00317.48
8.1.70.0040.00417.47
8.1.60.0060.00317.49
8.1.50.0000.00817.51
8.1.40.0040.00417.43
8.1.30.0040.00417.56
8.1.20.0030.00617.66
8.1.10.0020.00517.56
8.1.00.0070.00017.41
8.0.300.0000.00719.79
8.0.290.0000.00716.63
8.0.280.0000.00718.46
8.0.270.0030.00317.24
8.0.260.0000.00616.82
8.0.250.0030.00517.03
8.0.240.0030.00316.94
8.0.230.0030.00317.02
8.0.220.0070.00016.94
8.0.210.0030.00316.98
8.0.200.0000.00717.04
8.0.190.0030.00617.05
8.0.180.0000.00817.04
8.0.170.0040.00416.99
8.0.160.0050.00217.08
8.0.150.0060.00316.81
8.0.140.0000.00816.84
8.0.130.0030.00313.43
8.0.120.0050.00216.91
8.0.110.0050.00516.97
8.0.100.0090.00017.00
8.0.90.0000.00716.98
8.0.80.0080.00816.89
8.0.70.0000.00717.04
8.0.60.0050.00217.00
8.0.50.0000.00816.83
8.0.30.0110.00817.11
8.0.20.0160.00617.22
8.0.10.0000.00717.03
8.0.00.0140.00516.77
7.4.330.0050.00012.99
7.4.320.0000.00616.53
7.4.300.0000.00716.60
7.4.290.0000.00716.47
7.4.280.0000.00816.64
7.4.270.0070.00016.57
7.4.260.0000.00513.18
7.4.250.0000.00816.61
7.4.240.0030.00316.61
7.4.230.0020.00516.27
7.4.220.0060.02216.58
7.4.210.0080.00716.60
7.4.200.0030.00316.60
7.4.190.0030.00316.77
7.4.160.0090.00916.55
7.4.150.0140.00316.47
7.4.140.0090.01016.49
7.4.130.0070.01316.53
7.4.120.0070.01216.54
7.4.110.0070.01016.66
7.4.100.0090.00916.64
7.4.90.0090.01416.83
7.4.80.0080.00919.39
7.4.70.0030.01316.36
7.4.60.0070.01016.45
7.4.50.0030.00616.58
7.4.40.0030.01516.72
7.4.30.0100.00616.38
7.4.00.0040.01415.25
7.3.330.0060.00013.45
7.3.320.0000.00613.42
7.3.310.0040.00416.48
7.3.300.0030.00316.41
7.3.290.0060.01016.41
7.3.280.0070.01116.40
7.3.270.0070.01116.57
7.3.260.0160.00616.45
7.3.250.0120.00716.50
7.3.240.0110.00716.72
7.3.230.0070.01016.44
7.3.210.0040.01716.60
7.3.200.0150.00616.37
7.3.190.0080.01116.46
7.3.180.0040.01116.35
7.3.170.0170.00016.23
7.3.160.0060.01316.45
7.3.120.0060.01214.63
7.2.330.0130.00416.67
7.2.320.0140.00316.41
7.2.310.0190.00816.84
7.2.300.0110.00516.73
7.2.290.0080.00816.55
7.2.60.0060.00916.62
7.2.00.0070.01019.46
7.1.200.0170.01015.70
7.1.100.0030.00917.98
7.1.70.0040.00416.92
7.1.60.0070.01419.40
7.1.50.0060.00916.98
7.1.00.0070.07022.57
7.0.200.0370.00314.86
7.0.140.0000.07722.09
7.0.120.0100.07022.00
7.0.60.0100.08319.94
7.0.50.0000.04717.80
7.0.40.0030.04320.26
7.0.30.0100.06320.02
7.0.20.0030.09020.18
7.0.10.0100.08020.10
7.0.00.0130.07020.26
5.6.280.0030.07720.82
5.6.210.0070.04320.48
5.6.200.0100.08318.19
5.6.190.0030.04320.76
5.6.180.0100.08020.51
5.6.170.0070.04020.43
5.6.160.0100.08020.67
5.6.150.0070.05020.19
5.6.140.0100.08020.33
5.6.130.0100.04720.36
5.6.120.0100.04720.17
5.6.110.0130.07720.22
5.6.100.0100.05320.42
5.6.90.0070.04320.15
5.6.80.0070.07719.55
5.6.70.0170.06319.77
5.6.60.0030.05019.77
5.6.50.0100.06019.82
5.6.40.0100.07319.77
5.6.30.0000.05319.87
5.6.20.0000.06319.58
5.6.10.0030.04319.69
5.6.00.0070.04019.75
5.5.350.0230.05320.34
5.5.340.0070.07317.97
5.5.330.0000.06020.43
5.5.320.0030.07720.19
5.5.310.0070.04020.40
5.5.300.0130.07720.17
5.5.290.0100.04020.21
5.5.280.0100.07720.20
5.5.270.0030.05720.29
5.5.260.0070.09020.12
5.5.250.0030.04320.11
5.5.240.0100.08019.68
5.5.230.0100.05319.55
5.5.220.0200.03019.54
5.5.210.0000.08719.54
5.5.200.0100.05019.56
5.5.190.0070.05019.33
5.5.180.0000.05019.49
5.5.160.0030.04319.33
5.5.150.0170.07019.50
5.5.140.0000.05719.52
5.5.130.0100.08019.46
5.5.120.0030.05319.55
5.5.110.0070.08319.32
5.5.100.0100.07719.37
5.5.90.0000.07319.50
5.5.80.0100.05719.42
5.5.70.0070.08019.48
5.5.60.0100.08319.41
5.5.50.0000.06019.21
5.5.40.0100.07719.47
5.5.30.0070.08019.26
5.5.20.0100.05719.46
5.5.10.0000.04319.21
5.5.00.0100.04319.36
5.4.450.0130.07019.48
5.4.440.0030.04319.57
5.4.430.0030.07719.44
5.4.420.0170.07319.57
5.4.410.0000.05719.34
5.4.400.0130.07319.17
5.4.390.0100.07319.24
5.4.380.0070.05019.15
5.4.370.0130.04019.24
5.4.360.0000.05719.01
5.4.350.0100.07719.09
5.4.340.0170.06319.20
5.4.320.0070.08019.20
5.4.310.0230.06018.98
5.4.300.0030.04018.99
5.4.290.0030.05018.85
5.4.280.0100.05719.24
5.4.270.0030.08018.87
5.4.260.0000.05019.14
5.4.250.0100.07719.23
5.4.240.0100.06318.91
5.4.230.0070.08019.00
5.4.220.0170.06719.20
5.4.210.0070.07019.21
5.4.200.0070.06019.25
5.4.190.0130.04719.15
5.4.180.0070.04019.14
5.4.170.0130.06718.99
5.4.160.0070.08019.22
5.4.150.0070.07018.91
5.4.140.0030.06316.35
5.4.130.0100.06316.48
5.4.120.0070.06716.38
5.4.110.0070.06016.39
5.4.100.0030.05016.49
5.4.90.0070.07316.67
5.4.80.0030.08016.32
5.4.70.0070.07316.44
5.4.60.0030.04016.40
5.4.50.0070.05016.38
5.4.40.0100.06016.41
5.4.30.0000.05716.27
5.4.20.0030.07316.38
5.4.10.0070.06716.43
5.4.00.0030.05015.86
5.3.290.0130.07014.69
5.3.280.0200.06014.63
5.3.270.0070.07014.62
5.3.260.0030.04314.54
5.3.250.0000.05714.64
5.3.240.0030.05714.67
5.3.230.0070.07714.61
5.3.220.0030.06714.50
5.3.210.0070.07314.58
5.3.200.0030.05014.72
5.3.190.0030.05014.61
5.3.180.0000.08014.47
5.3.170.0100.06714.59
5.3.160.0070.07714.61
5.3.150.0100.06714.73
5.3.140.0100.06014.72
5.3.130.0100.07014.62
5.3.120.0030.08314.64
5.3.110.0030.07314.62
5.3.100.0100.05314.21
5.3.90.0100.05714.07
5.3.80.0070.05314.05
5.3.70.0030.04014.06
5.3.60.0070.04314.07
5.3.50.0070.05313.85
5.3.40.0100.04013.95
5.3.30.0030.07713.92
5.3.20.0070.05313.65
5.3.10.0030.07713.74
5.3.00.0170.05713.57
5.2.170.0130.02711.09
5.2.160.0030.04711.23
5.2.150.0070.03311.09
5.2.140.0030.04310.97
5.2.130.0100.05011.01
5.2.120.0070.03711.07
5.2.110.0070.06311.04
5.2.100.0100.05710.99
5.2.90.0030.05011.00
5.2.80.0030.03310.99
5.2.70.0030.03711.08
5.2.60.0030.03310.91
5.2.50.0070.02710.95
5.2.40.0000.05010.86
5.2.30.0030.04011.05
5.2.20.0000.07011.13
5.2.10.0000.03710.91
5.2.00.0030.03310.57
5.1.60.0170.03710.01
5.1.50.0030.04310.01
5.1.40.0030.0509.96
5.1.30.0070.05710.19
5.1.20.0130.03010.39
5.1.10.0030.03310.05
5.1.00.0070.03010.05
5.0.50.0030.0208.52
5.0.40.0070.0308.37
5.0.30.0070.0308.14
5.0.20.0000.0208.23
5.0.10.0000.0208.20
5.0.00.0000.0308.20
4.4.90.0070.0136.78
4.4.80.0000.0206.78
4.4.70.0070.0176.78
4.4.60.0030.0236.78
4.4.50.0030.0376.78
4.4.40.0000.0576.78
4.4.30.0000.0406.78
4.4.20.0030.0236.78
4.4.10.0070.0206.78
4.4.00.0000.0306.78
4.3.110.0000.0206.78
4.3.100.0030.0136.78
4.3.90.0030.0336.78
4.3.80.0070.0206.78
4.3.70.0000.0236.78
4.3.60.0000.0206.78
4.3.50.0000.0206.78
4.3.40.0000.0276.78
4.3.30.0000.0336.78
4.3.20.0000.0276.78
4.3.10.0000.0206.78
4.3.00.0000.0136.78

preferences:
59.33 ms | 401 KiB | 5 Q