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));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eh4uD
function name:  (null)
number of ops:  23
compiled vars:  !0 = $str, !1 = $arr, !2 = $loan
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%5B++%0A+++%7B++%0A++++++%22id%22%3A5%2C%0A++++++%22firstname%22%3A%22Joel+%22%2C%0A++++++%22lastname%22%3A%22Abase%22%2C%0A++++++%22displayName%22%3A%22Abase%2C+Joel+%22%2C%0A++++++%22officeId%22%3A3%2C%0A++++++%22officeName%22%3A%22Birmingham%22%2C%0A++++++%22isLoanOfficer%22%3Atrue%2C%0A++++++%22isActive%22%3Atrue%0A+++%7D%2C%0A+++%7B++%0A++++++%22id%22%3A1%2C%0A++++++%22firstname%22%3A%22Precious+%22%2C%0A++++++%22lastname%22%3A%22Love%22%2C%0A++++++%22displayName%22%3A%22Love%2C+Precious+%22%2C%0A++++++%22officeId%22%3A4%2C%0A++++++%22officeName%22%3A%22Manchester%22%2C%0A++++++%22isLoanOfficer%22%3Atrue%2C%0A++++++%22isActive%22%3Atrue%0A+++%7D%2C%0A+++%7B++%0A++++++%22id%22%3A2%2C%0A++++++%22firstname%22%3A%22Bernard+%22%2C%0A++++++%22lastname%22%3A%22Aikins%22%2C%0A++++++%22displayName%22%3A%22Aikins%2C+Bernice+%22%2C%0A++++++%22officeId%22%3A2%2C%0A++++++%22officeName%22%3A%22Manchester%22%2C%0A++++++%22isLoanOfficer%22%3Afalse%2C%0A++++++%22isActive%22%3Atrue%0A+++%7D%2C%0A+++%7B++%0A++++++%22id%22%3A8%2C%0A++++++%22firstname%22%3A%22Kwame%22%2C%0A++++++%22lastname%22%3A%22Joseph%22%2C%0A++++++%22displayName%22%3A%22Joseph%2C+Kwame%22%2C%0A++++++%22officeId%22%3A2%2C%0A++++++%22officeName%22%3A%22Manchester%22%2C%0A++++++%22isLoanOfficer%22%3Atrue%2C%0A++++++%22isActive%22%3Atrue%2C%0A++++++%22joiningDate%22%3A%5B++%0A+++++++++2018%2C%0A+++++++++5%2C%0A+++++++++1%0A++++++%5D%0A+++%7D%2C%0A+++%7B++%0A++++++%22id%22%3A4%2C%0A++++++%22firstname%22%3A%22Janine+%22%2C%0A++++++%22lastname%22%3A%22Hayden%22%2C%0A++++++%22displayName%22%3A%22Hayden%2C+Janine+%22%2C%0A++++++%22officeId%22%3A1%2C%0A++++++%22officeName%22%3A%22Head+Office%22%2C%0A++++++%22isLoanOfficer%22%3Afalse%2C%0A++++++%22isActive%22%3Atrue%0A+++%7D%2C%0A+++%7B++%0A++++++%22id%22%3A6%2C%0A++++++%22firstname%22%3A%22Esther%22%2C%0A++++++%22lastname%22%3A%22Monroe%22%2C%0A++++++%22displayName%22%3A%22Monroe%2C+Esther%22%2C%0A++++++%22officeId%22%3A2%2C%0A++++++%22officeName%22%3A%22London%22%2C%0A++++++%22isLoanOfficer%22%3Atrue%2C%0A++++++%22isActive%22%3Atrue%2C%0A++++++%22joiningDate%22%3A%5B++%0A+++++++++2017%2C%0A+++++++++11%2C%0A+++++++++1%0A++++++%5D%0A+++%7D%0A%5D'
   76     1        INIT_FCALL                                                   'json_decode'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     <true>
          4        DO_ICALL                                             $4      
          5        ASSIGN                                                       !1, $4
   77     6        INIT_FCALL                                                   'array_intersect'
          7        INIT_FCALL                                                   'array_column'
          8        SEND_VAR                                                     !1
          9        SEND_VAL                                                     'isLoanOfficer'
         10        DO_ICALL                                             $6      
         11        SEND_VAR                                                     $6
         12        SEND_VAL                                                     <array>
         13        DO_ICALL                                             $7      
         14        ASSIGN                                                       !2, $7
   78    15        INIT_FCALL                                                   'var_dump'
         16        INIT_FCALL                                                   'array_intersect_key'
         17        SEND_VAR                                                     !1
         18        SEND_VAR                                                     !2
         19        DO_ICALL                                             $9      
         20        SEND_VAR                                                     $9
         21        DO_ICALL                                                     
         22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.28 ms | 2568 KiB | 18 Q