3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{"locations":"Bangalore","requestor_department":"DC","requestor_department_count":"3"}{"locations":"Bangalore","requestor_department":"EBA","requestor_department_count":"1"}{"locations":"Chennai","requestor_department":"DC","requestor_department_count":"34"}{"locations":"Chennai","requestor_department":"EBA","requestor_department_count":"20"}{"locations":"Cochin","requestor_department":"DC","requestor_department_count":"4"}{"locations":"Cochin","requestor_department":"EBA","requestor_department_count":"2"}{"locations":"Hyderabad","requestor_department":"DC","requestor_department_count":"58"}{"locations":"Hyderabad","requestor_department":"EBA","requestor_department_count":"18"}{"locations":"Kolkata","requestor_department":"DC","requestor_department_count":"37"}{"locations":"Kolkata","requestor_department":"EBA","requestor_department_count":"8"}{"locations":"Pune","requestor_department":"DC","requestor_department_count":"26"}{"locations":"Pune","requestor_department":"EBA","requestor_department_count":"11"}'; $json2array = json_decode($json, true); $dcData = array(); $ebaData = array(); foreach($json2array as $row) { if($row['requestor_department'] == "DC") array_push($dcData, $row['requestor_department_count']); if($row['requestor_department'] == "EBA") array_push($ebaData, $row['requestor_department_count']); } echo json_encode($dcData); echo json_encode($ebaData); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 27
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 27
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 26
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 26
Branch analysis from position: 18
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/NuQP0
function name:  (null)
number of ops:  37
compiled vars:  !0 = $json, !1 = $json2array, !2 = $dcData, !3 = $ebaData, !4 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B%22locations%22%3A%22Bangalore%22%2C%22requestor_department%22%3A%22DC%22%2C%22requestor_department_count%22%3A%223%22%7D%7B%22locations%22%3A%22Bangalore%22%2C%22requestor_department%22%3A%22EBA%22%2C%22requestor_department_count%22%3A%221%22%7D%7B%22locations%22%3A%22Chennai%22%2C%22requestor_department%22%3A%22DC%22%2C%22requestor_department_count%22%3A%2234%22%7D%7B%22locations%22%3A%22Chennai%22%2C%22requestor_department%22%3A%22EBA%22%2C%22requestor_department_count%22%3A%2220%22%7D%7B%22locations%22%3A%22Cochin%22%2C%22requestor_department%22%3A%22DC%22%2C%22requestor_department_count%22%3A%224%22%7D%7B%22locations%22%3A%22Cochin%22%2C%22requestor_department%22%3A%22EBA%22%2C%22requestor_department_count%22%3A%222%22%7D%7B%22locations%22%3A%22Hyderabad%22%2C%22requestor_department%22%3A%22DC%22%2C%22requestor_department_count%22%3A%2258%22%7D%7B%22locations%22%3A%22Hyderabad%22%2C%22requestor_department%22%3A%22EBA%22%2C%22requestor_department_count%22%3A%2218%22%7D%7B%22locations%22%3A%22Kolkata%22%2C%22requestor_department%22%3A%22DC%22%2C%22requestor_department_count%22%3A%2237%22%7D%7B%22locations%22%3A%22Kolkata%22%2C%22requestor_department%22%3A%22EBA%22%2C%22requestor_department_count%22%3A%228%22%7D%7B%22locations%22%3A%22Pune%22%2C%22requestor_department%22%3A%22DC%22%2C%22requestor_department_count%22%3A%2226%22%7D%7B%22locations%22%3A%22Pune%22%2C%22requestor_department%22%3A%22EBA%22%2C%22requestor_department_count%22%3A%2211%22%7D'
    3     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    4     6        ASSIGN                                                   !2, <array>
          7        ASSIGN                                                   !3, <array>
    5     8      > FE_RESET_R                                       $10     !1, ->27
          9    > > FE_FETCH_R                                               $10, !4, ->27
    7    10    >   FETCH_DIM_R                                      ~11     !4, 'requestor_department'
         11        IS_EQUAL                                                 ~11, 'DC'
         12      > JMPZ                                                     ~12, ->18
    8    13    >   INIT_FCALL                                               'array_push'
         14        SEND_REF                                                 !2
         15        FETCH_DIM_R                                      ~13     !4, 'requestor_department_count'
         16        SEND_VAL                                                 ~13
         17        DO_ICALL                                                 
    9    18    >   FETCH_DIM_R                                      ~15     !4, 'requestor_department'
         19        IS_EQUAL                                                 ~15, 'EBA'
         20      > JMPZ                                                     ~16, ->26
   10    21    >   INIT_FCALL                                               'array_push'
         22        SEND_REF                                                 !3
         23        FETCH_DIM_R                                      ~17     !4, 'requestor_department_count'
         24        SEND_VAL                                                 ~17
         25        DO_ICALL                                                 
    5    26    > > JMP                                                      ->9
         27    >   FE_FREE                                                  $10
   12    28        INIT_FCALL                                               'json_encode'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                         $19     
         31        ECHO                                                     $19
   13    32        INIT_FCALL                                               'json_encode'
         33        SEND_VAR                                                 !3
         34        DO_ICALL                                         $20     
         35        ECHO                                                     $20
   14    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.41 ms | 1400 KiB | 19 Q