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 $val){ $new_arr[$val['date']] = $val['count']; } foreach($date as $key => $val){ $result[$key]['count'] = isset($new_arr[$val]) ? $new_arr[$val] : 0; $result[$key]['date'] = $val; } print_r($result); //对应$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] => 0 [date] => 2014-04-17 ) [2] => Array ( [count] => 50 [date] => 2014-04-18 ) [3] => Array ( [count] => 0 [date] => 2014-04-19 ) [4] => Array ( [count] => 80 [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:
40.16 ms | 402 KiB | 8 Q