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']; } foreach($arr as $k2 =>$v2 ){foreach($date as $k =>$v ){ if(!array_key_exists($v,$tt)){ $arr[]=array("count"=>0,"date"=>$v); } } } print_r($arr); //对应$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") );
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [count] => 10 [date] => 2014-04-16 ) [1] => Array ( [count] => 50 [date] => 2014-04-18 ) [2] => Array ( [count] => 80 [date] => 2014-04-20 ) [3] => Array ( [count] => 0 [date] => 2014-04-16 ) [4] => Array ( [count] => 0 [date] => 2014-04-17 ) [5] => Array ( [count] => 0 [date] => 2014-04-18 ) [6] => Array ( [count] => 0 [date] => 2014-04-19 ) [7] => Array ( [count] => 0 [date] => 2014-04-20 ) [8] => Array ( [count] => 0 [date] => 2014-04-16 ) [9] => Array ( [count] => 0 [date] => 2014-04-17 ) [10] => Array ( [count] => 0 [date] => 2014-04-18 ) [11] => Array ( [count] => 0 [date] => 2014-04-19 ) [12] => Array ( [count] => 0 [date] => 2014-04-20 ) [13] => Array ( [count] => 0 [date] => 2014-04-16 ) [14] => Array ( [count] => 0 [date] => 2014-04-17 ) [15] => Array ( [count] => 0 [date] => 2014-04-18 ) [16] => Array ( [count] => 0 [date] => 2014-04-19 ) [17] => Array ( [count] => 0 [date] => 2014-04-20 ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
62.63 ms | 405 KiB | 8 Q