3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getUA($data, $univ_seg) { return array_filter(json_decode($data, true), function($var) use($univ_seg) { return $var["EventType"] == "UN" && $var["LocationURL"] == $univ_seg; }); } $data = json_encode(array( array("StartDate"=>"2014/07/31","LocZipCode"=>"19406","LocationURL"=>"FSU","EventType"=>"UN"), array("StartDate"=>"2014/08/31","LocZipCode"=>"23513","LocationURL"=>"FSU","EventType"=>"UN"), array("StartDate"=>"2014/07/31","LocZipCode"=>"92108","LocationURL"=>"BU","EventType"=>"UN"), array("StartDate"=>"2014/09/30","LocZipCode"=>"78661","LocationURL"=>"BU","EventType"=>"UN") )); $univ_seg = 'FSU'; $ua = getUA($data, $univ_seg); print_r($ua);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [StartDate] => 2014/07/31 [LocZipCode] => 19406 [LocationURL] => FSU [EventType] => UN ) [1] => Array ( [StartDate] => 2014/08/31 [LocZipCode] => 23513 [LocationURL] => FSU [EventType] => UN ) )

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:
39.83 ms | 402 KiB | 8 Q