3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str= '[ { "id":5, "firstname":"Joel ", "lastname":"Abase", "displayName":"Abase, Joel ", "officeId":3, "officeName":"Birmingham", "isLoanOfficer":true, "isActive":true }, { "id":1, "firstname":"Precious ", "lastname":"Love", "displayName":"Love, Precious ", "officeId":4, "officeName":"Manchester", "isLoanOfficer":true, "isActive":true }, { "id":2, "firstname":"Bernard ", "lastname":"Aikins", "displayName":"Aikins, Bernice ", "officeId":2, "officeName":"Manchester", "isLoanOfficer":false, "isActive":true }, { "id":8, "firstname":"Kwame", "lastname":"Joseph", "displayName":"Joseph, Kwame", "officeId":2, "officeName":"Manchester", "isLoanOfficer":true, "isActive":true, "joiningDate":[ 2018, 5, 1 ] }, { "id":4, "firstname":"Janine ", "lastname":"Hayden", "displayName":"Hayden, Janine ", "officeId":1, "officeName":"Head Office", "isLoanOfficer":false, "isActive":true }, { "id":6, "firstname":"Esther", "lastname":"Monroe", "displayName":"Monroe, Esther", "officeId":2, "officeName":"London", "isLoanOfficer":true, "isActive":true, "joiningDate":[ 2017, 11, 1 ] } ]'; $arr = json_decode($str, true); $loan = array_intersect(array_column($arr, "isLoanOfficer"), [true]); var_dump(array_intersect_key($arr, $loan));
Output for git.master, git.master_jit, rfc.property-hooks
array(4) { [0]=> array(8) { ["id"]=> int(5) ["firstname"]=> string(5) "Joel " ["lastname"]=> string(5) "Abase" ["displayName"]=> string(12) "Abase, Joel " ["officeId"]=> int(3) ["officeName"]=> string(10) "Birmingham" ["isLoanOfficer"]=> bool(true) ["isActive"]=> bool(true) } [1]=> array(8) { ["id"]=> int(1) ["firstname"]=> string(9) "Precious " ["lastname"]=> string(4) "Love" ["displayName"]=> string(15) "Love, Precious " ["officeId"]=> int(4) ["officeName"]=> string(10) "Manchester" ["isLoanOfficer"]=> bool(true) ["isActive"]=> bool(true) } [3]=> array(9) { ["id"]=> int(8) ["firstname"]=> string(5) "Kwame" ["lastname"]=> string(6) "Joseph" ["displayName"]=> string(13) "Joseph, Kwame" ["officeId"]=> int(2) ["officeName"]=> string(10) "Manchester" ["isLoanOfficer"]=> bool(true) ["isActive"]=> bool(true) ["joiningDate"]=> array(3) { [0]=> int(2018) [1]=> int(5) [2]=> int(1) } } [5]=> array(9) { ["id"]=> int(6) ["firstname"]=> string(6) "Esther" ["lastname"]=> string(6) "Monroe" ["displayName"]=> string(14) "Monroe, Esther" ["officeId"]=> int(2) ["officeName"]=> string(6) "London" ["isLoanOfficer"]=> bool(true) ["isActive"]=> bool(true) ["joiningDate"]=> array(3) { [0]=> int(2017) [1]=> int(11) [2]=> int(1) } } }

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:
44.96 ms | 1942 KiB | 4 Q