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) //} $tt[]=$v['date'];$cc[]=$v['count']; $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]=0;} }print_r($new); //} 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.0090.00918.43
8.3.50.0070.01016.55
8.3.40.0060.00919.01
8.3.30.0080.00818.97
8.3.20.0080.00018.88
8.3.10.0060.00318.73
8.3.00.0060.00319.26
8.2.180.0060.00916.75
8.2.170.0110.00322.96
8.2.160.0100.00618.87
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0070.00021.05
8.2.110.0030.00720.49
8.2.100.0040.00718.03
8.2.90.0050.00318.16
8.2.80.0000.00818.05
8.2.70.0060.00317.63
8.2.60.0030.00517.93
8.2.50.0000.00818.05
8.2.40.0060.00319.60
8.2.30.0080.00017.85
8.2.20.0030.00617.80
8.2.10.0030.00517.68
8.2.00.0060.00317.87
8.1.280.0080.00625.92
8.1.270.0030.00623.99
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00722.55
8.1.230.0110.00020.88
8.1.220.0050.00317.74
8.1.210.0080.00019.00
8.1.200.0030.00617.35
8.1.190.0000.00817.35
8.1.180.0060.00318.87
8.1.170.0050.00217.62
8.1.160.0040.00419.06
8.1.150.0080.00018.65
8.1.140.0080.00017.42
8.1.130.0000.00719.10
8.1.120.0000.00717.38
8.1.110.0040.00417.44
8.1.100.0020.00517.45
8.1.90.0050.00217.36
8.1.80.0000.00717.49
8.1.70.0000.00717.43
8.1.60.0040.00417.57
8.1.50.0060.00317.40
8.1.40.0040.00417.54
8.1.30.0050.00317.49
8.1.20.0000.00717.57
8.1.10.0040.00417.48
8.1.00.0000.00917.48
8.0.300.0000.00719.89
8.0.290.0000.00816.75
8.0.280.0030.00318.48
8.0.270.0070.00017.22
8.0.260.0030.00316.82
8.0.250.0000.00716.93
8.0.240.0040.00416.99
8.0.230.0000.00717.03
8.0.220.0000.00716.95
8.0.210.0000.00716.99
8.0.200.0030.00617.04
8.0.190.0030.00616.95
8.0.180.0070.00017.03
8.0.170.0040.00416.87
8.0.160.0040.00417.00
8.0.150.0090.00016.98
8.0.140.0000.00816.91
8.0.130.0060.00013.39
8.0.120.0000.00816.86
8.0.110.0040.00416.80
8.0.100.0040.00416.99
8.0.90.0040.00416.84
8.0.80.0100.00716.97
8.0.70.0040.00416.91
8.0.60.0050.00316.92
8.0.50.0070.00016.80
8.0.30.0070.01016.93
8.0.20.0100.00917.04
8.0.10.0040.00417.12
8.0.00.0090.00916.94
7.4.330.0050.00012.98
7.4.320.0030.00316.63
7.4.300.0030.00316.51
7.4.290.0040.00416.43
7.4.280.0040.00416.59
7.4.270.0050.00316.63
7.4.260.0000.00513.26
7.4.250.0000.00716.48
7.4.240.0030.00316.59
7.4.230.0030.00316.62
7.4.220.0120.00616.55
7.4.210.0070.01416.67
7.4.200.0070.00016.65
7.4.190.0030.00616.47
7.4.160.0120.00416.61
7.4.150.0130.01316.50
7.4.140.0090.00917.86
7.4.130.0080.01116.68
7.4.120.0070.01016.86
7.4.110.0070.01116.53
7.4.100.0070.01016.60
7.4.90.0040.01516.57
7.4.80.0080.01519.39
7.4.70.0080.00916.68
7.4.60.0130.00716.43
7.4.50.0070.00316.49
7.4.40.0140.00316.53
7.4.30.0140.00316.44
7.4.10.0000.01615.07
7.4.00.0070.01014.95
7.3.330.0030.00313.36
7.3.320.0060.00013.26
7.3.310.0040.00416.32
7.3.300.0030.00316.26
7.3.290.0060.01016.43
7.3.280.0100.00416.49
7.3.270.0100.00716.35
7.3.260.0180.00316.47
7.3.240.0190.00316.69
7.3.230.0070.01016.60
7.3.210.0100.00716.67
7.3.200.0090.00916.38
7.3.190.0040.01116.55
7.3.180.0110.00416.49
7.3.170.0080.00816.43
7.3.160.0060.01516.45
7.3.130.0070.01114.89
7.3.120.0100.00514.89
7.3.110.0080.00914.83
7.3.100.0120.00514.98
7.3.90.0070.00914.85
7.3.80.0070.00415.02
7.3.70.0070.00814.81
7.3.60.0050.01014.90
7.3.50.0040.00514.74
7.3.40.0050.00914.81
7.3.30.0040.00914.64
7.3.20.0080.00516.69
7.3.10.0060.00516.71
7.3.00.0100.00416.68
7.2.330.0110.00716.78
7.2.320.0060.01616.70
7.2.310.0060.01316.47
7.2.300.0130.00316.68
7.2.290.0100.01016.59
7.2.260.0090.00915.36
7.2.250.0090.00715.12
7.2.240.0090.00815.07
7.2.230.0030.01115.18
7.2.220.0080.00715.10
7.2.210.0050.00715.13
7.2.200.0110.00514.94
7.2.190.0100.00515.18
7.2.180.0030.00915.04
7.2.170.0070.01115.12
7.2.160.0060.00615.13
7.2.150.0050.00716.91
7.2.140.0030.00916.79
7.2.130.0070.00717.05
7.2.120.0090.00616.86
7.2.110.0070.00617.00
7.2.100.0050.01217.06
7.2.90.0080.00717.03
7.2.80.0090.00516.97
7.2.70.0070.01016.97
7.2.60.0030.01117.07
7.2.50.0050.00816.88
7.2.40.0070.00716.99
7.2.30.0060.00816.99
7.2.20.0040.01116.97
7.2.10.0090.00617.04
7.2.00.0070.00917.79
7.1.330.0080.00715.90
7.1.320.0070.00815.82
7.1.310.0050.01016.03
7.1.300.0070.00515.75
7.1.290.0100.00315.62
7.1.280.0100.00415.62
7.1.270.0050.01015.82
7.1.260.0080.00715.81
7.1.250.0060.00715.84
7.1.240.0080.00315.84
7.1.230.0050.00715.78
7.1.220.0020.01115.92
7.1.210.0060.00415.76
7.1.200.0080.00515.95
7.1.190.0030.00615.70
7.1.180.0080.00515.78
7.1.170.0090.00515.94
7.1.160.0040.00715.93
7.1.150.0020.01215.70
7.1.140.0070.00715.71
7.1.130.0030.00815.63
7.1.120.0020.01415.90
7.1.110.0040.01215.73
7.1.100.0060.00616.51
7.1.90.0040.00715.97
7.1.80.0020.01015.62
7.1.70.0040.00816.27
7.1.60.0040.01216.97
7.1.50.0040.01116.29
7.1.40.0020.01215.77
7.1.30.0050.01015.61
7.1.20.0050.00816.01
7.1.10.0080.00315.90
7.1.00.0040.02717.96
7.0.330.0030.01115.36
7.0.320.0090.00415.35
7.0.310.0030.01115.37
7.0.300.0110.00515.30
7.0.290.0000.01015.37
7.0.280.0100.00515.50
7.0.270.0070.00515.42
7.0.260.0070.00715.42
7.0.250.0060.01015.56
7.0.240.0060.00515.39
7.0.230.0050.00915.28
7.0.220.0060.00615.48
7.0.210.0080.00715.55
7.0.200.0040.00615.83
7.0.190.0050.00815.54
7.0.180.0080.00715.46
7.0.170.0070.00315.36
7.0.160.0050.01015.60
7.0.150.0070.00815.38
7.0.140.0070.02917.63
7.0.130.0050.00815.51
7.0.120.0070.02317.61
7.0.110.0050.00515.38
7.0.100.0030.00915.30
7.0.90.0080.00715.43
7.0.80.0070.00715.44
7.0.70.0030.01215.38
7.0.60.0040.03317.05
7.0.50.0060.03016.08
7.0.40.0090.03015.71
7.0.30.0220.01615.78
7.0.20.0170.03315.77
7.0.10.0070.02515.77
7.0.00.0030.02015.76
5.6.400.0060.00614.53
5.6.390.0050.00914.45
5.6.380.0030.00814.43
5.6.370.0030.01014.25
5.6.360.0080.00614.54
5.6.350.0100.00314.30
5.6.340.0000.01414.58
5.6.330.0050.01014.46
5.6.320.0050.00814.47
5.6.310.0050.01114.73
5.6.300.0060.00814.28
5.6.290.0050.01014.38
5.6.280.0070.02616.64
5.6.270.0100.00514.50
5.6.260.0080.00614.39
5.6.250.0090.00714.39
5.6.240.0080.00514.59
5.6.230.0020.01614.43
5.6.220.0080.00814.60
5.6.210.0090.02316.53
5.6.200.0090.02215.76
5.6.190.0070.02916.43
5.6.180.1360.02116.57
5.6.170.0080.02316.52
5.6.160.0030.01916.46
5.6.150.0050.02515.79
5.6.140.0060.01815.80
5.6.130.0090.03115.81
5.6.120.0070.02616.51
5.6.110.0060.03316.61
5.6.100.0090.02916.61
5.6.90.0070.03216.73
5.6.80.0080.03116.26
5.6.70.1050.01616.49
5.6.60.0080.00614.34
5.6.50.0060.01114.39
5.6.40.0050.00714.29
5.6.30.0040.00714.21
5.6.20.0050.01114.25
5.6.10.0050.01014.27
5.6.00.0020.01214.45
5.5.380.0030.00814.39
5.5.370.0120.00314.29
5.5.360.0030.00814.40
5.5.350.0140.02316.40
5.5.340.0090.02515.55
5.5.330.0090.01616.43
5.5.320.0170.03016.34
5.5.310.0160.02916.40
5.5.300.0040.03315.63
5.5.290.0040.02715.65
5.5.280.0060.03316.69
5.5.270.0060.02516.51
5.5.260.0060.03516.51
5.5.250.0060.03016.41
5.5.240.0060.01916.39
5.5.230.0020.00914.18
5.5.220.0030.01114.37
5.5.210.0060.01014.42
5.5.200.0050.00914.11
5.5.190.0100.00314.25
5.5.180.0070.00514.28
5.5.170.0100.00514.09
5.5.160.0050.00814.22
5.5.150.0050.00514.32
5.5.140.0060.00514.42
5.5.130.0080.00314.45
5.5.120.0090.00514.26
5.5.110.0050.01014.28
5.5.100.0060.00514.38
5.5.90.0060.00614.21
5.5.80.0060.00914.30
5.5.70.0030.00814.38
5.5.60.0060.00714.32
5.5.50.0080.00514.29
5.5.40.0040.00814.35
5.5.30.0060.00614.24
5.5.20.0030.00814.09
5.5.10.0090.00314.35
5.5.00.0050.00514.26
5.4.450.0080.02314.95
5.4.440.0090.01815.06
5.4.430.0100.03114.97
5.4.420.0170.02514.98
5.4.410.0120.02715.02
5.4.400.0080.01714.88
5.4.390.0110.01914.94
5.4.380.0110.02614.92
5.4.370.0120.01714.88
5.4.360.0090.01614.91
5.4.350.0100.02414.83
5.4.340.0120.02814.99
5.4.330.0080.00512.82
5.4.320.0120.02314.92
5.4.310.0110.02214.96
5.4.300.0110.03114.98
5.4.290.0110.01714.91
5.4.280.0080.02214.95
5.4.270.0110.01714.96
5.4.260.0090.02014.93
5.4.250.0170.02214.91
5.4.240.0110.02914.91
5.4.230.0110.01714.92
5.4.220.0150.02214.94
5.4.210.0130.02214.92
5.4.200.0120.02414.96
5.4.190.0110.02014.95
5.4.180.0090.01814.88
5.4.170.0130.03014.83
5.4.160.0130.01614.82
5.4.150.0090.03014.92
5.4.140.0140.02413.99
5.4.130.0140.01913.99
5.4.120.0100.01914.04
5.4.110.0120.02814.02
5.4.100.0140.01514.06
5.4.90.0140.02214.03
5.4.80.0140.02714.03
5.4.70.0130.02414.03
5.4.60.0110.01813.97
5.4.50.0070.02514.02
5.4.40.0130.02514.02
5.4.30.0100.01714.02
5.4.20.0180.01614.05
5.4.10.0140.01414.06
5.4.00.0100.03113.81
5.3.290.0110.01613.46
5.3.280.0130.02813.42
5.3.270.0130.01613.44
5.3.260.0090.02113.44
5.3.250.0110.01913.42
5.3.240.0100.01513.41
5.3.230.0070.01613.39
5.3.220.0110.01413.43
5.3.210.0080.01513.38
5.3.200.0070.01613.38
5.3.190.0060.02113.38
5.3.180.0090.01813.45
5.3.170.0090.01513.41
5.3.160.0100.01313.41
5.3.150.0130.01413.38
5.3.140.0070.01713.43
5.3.130.0070.01913.38
5.3.120.0090.01613.39
5.3.110.0070.01813.40
5.3.100.0100.01513.22
5.3.90.0090.01713.21
5.3.80.0090.01513.19
5.3.70.0090.01513.20
5.3.60.0080.01613.19
5.3.50.0100.01413.19
5.3.40.0090.01413.17
5.3.30.0060.01913.16
5.3.20.0120.01613.08
5.3.10.0110.01113.12
5.3.00.0110.01313.07
5.2.170.0130.03011.17
5.2.160.0130.02711.18
5.2.150.0170.02710.99
5.2.140.0200.03010.99
5.2.130.0130.02711.03
5.2.120.0070.03310.97
5.2.110.0200.02711.00
5.2.100.0100.03311.13
5.2.90.0070.03710.96
5.2.80.0300.03010.96
5.2.70.0230.02311.02
5.2.60.0170.03011.11
5.2.50.0130.03310.92
5.2.40.0070.03010.90
5.2.30.0130.02710.89
5.2.20.0170.03011.13
5.2.10.0170.02310.89
5.2.00.0170.03010.64
5.1.60.0170.0309.88
5.1.50.0130.0239.90
5.1.40.0070.02710.15
5.1.30.0070.03010.37
5.1.20.0230.03310.32
5.1.10.0100.02710.02
5.1.00.0030.0309.98
5.0.50.0030.0208.49
5.0.40.0230.0238.36
5.0.30.0030.0338.36
5.0.20.0200.0178.36
5.0.10.0070.0178.36
5.0.00.0070.0308.36
4.4.90.0070.0138.36
4.4.80.0070.0138.36
4.4.70.0070.0178.36
4.4.60.0030.0208.36
4.4.50.0070.0138.36
4.4.40.0000.0308.36
4.4.30.0070.0138.36
4.4.20.0030.0178.36
4.4.10.0100.0108.36
4.4.00.0030.0278.36
4.3.110.0030.0178.36
4.3.100.0070.0138.36
4.3.90.0070.0138.36
4.3.80.0030.0238.36
4.3.70.0030.0178.36
4.3.60.0070.0178.36
4.3.50.0070.0138.36
4.3.40.0030.0238.36
4.3.30.0130.0178.36
4.3.20.0000.0178.36
4.3.10.0000.0178.36
4.3.00.0170.0178.36

preferences:
45.9 ms | 401 KiB | 5 Q