3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = json_decode('{ "ErrorCode": "00", "ErrorMessage": "", "ServiceList": { "ServiceDetail": [ { "Service_name": [ "LTE_DATA_PRI_1", "LTE_ONM_PRI_2" ], "AVLAN": [ "LTE_DATA_PRI_SITE_1", "LTE_DATA_PRI_SITE_2" ], "IpAddress": [ "192.168.1/20", "192.168.2/20" ], "AggPort": [ "GigabitEthernet 1/1/10.1000", "GigabitEthernet 1/1/10.1001" ] }, "\r\n", "\r\n", { "Service_name": [ "LTE_DATA_SEC_1", "LTE_ONM_SEC_2" ], "AVLAN": [ "LTE_DATA_SEC_SITE_1", "LTE_DATA_SEC_SITE_2" ], "IpAddress": [ "192.168.3/20", "192.168.4/20" ], "AggPort": [ "GigabitEthernet 1/1/10.1003", "GigabitEthernet 1/1/10.1004" ] }, "\r\n", "\r\n" ] } }', true); foreach($array['ServiceList']['ServiceDetail'] as $serviceDetail) { if(is_array($serviceDetail)) { foreach($serviceDetail['Service_name'] as $key => $p_service_name) { $p_avlan = $serviceDetail['AVLAN'][$key]; $p_ip_address = $serviceDetail['IpAddress'][$key]; $p_agg_port = $serviceDetail['AggPort'][$key]; var_dump($p_service_name, $p_avlan, $p_ip_address, $p_agg_port); } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 33
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 33
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 32
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 31
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 31
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 31
Branch analysis from position: 32
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/O9MWM
function name:  (null)
number of ops:  35
compiled vars:  !0 = $array, !1 = $serviceDetail, !2 = $p_service_name, !3 = $key, !4 = $p_avlan, !5 = $p_ip_address, !6 = $p_agg_port
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%0A++%22ErrorCode%22%3A+%2200%22%2C%0A++%22ErrorMessage%22%3A+%22%22%2C%0A++%22ServiceList%22%3A+%7B%0A++++%22ServiceDetail%22%3A+%5B%0A++++++%7B%0A++++++++%22Service_name%22%3A+%5B%0A++++++++++%22LTE_DATA_PRI_1%22%2C%0A++++++++++%22LTE_ONM_PRI_2%22%0A++++++++%5D%2C%0A++++++++%22AVLAN%22%3A+%5B%0A++++++++++%22LTE_DATA_PRI_SITE_1%22%2C%0A++++++++++%22LTE_DATA_PRI_SITE_2%22%0A++++++++%5D%2C%0A++++++++%22IpAddress%22%3A+%5B%0A++++++++++%22192.168.1%2F20%22%2C%0A++++++++++%22192.168.2%2F20%22%0A++++++++%5D%2C%0A++++++++%22AggPort%22%3A+%5B%0A++++++++++%22GigabitEthernet+1%2F1%2F10.1000%22%2C%0A++++++++++%22GigabitEthernet+1%2F1%2F10.1001%22%0A++++++++%5D%0A++++++%7D%2C%0A++++++%22%5Cr%5Cn%22%2C%0A++++++%22%5Cr%5Cn%22%2C%0A++++++%7B%0A++++++++%22Service_name%22%3A+%5B%0A++++++++++%22LTE_DATA_SEC_1%22%2C%0A++++++++++%22LTE_ONM_SEC_2%22%0A++++++++%5D%2C%0A++++++++%22AVLAN%22%3A+%5B%0A++++++++++%22LTE_DATA_SEC_SITE_1%22%2C%0A++++++++++%22LTE_DATA_SEC_SITE_2%22%0A++++++++%5D%2C%0A++++++++%22IpAddress%22%3A+%5B%0A++++++++++%22192.168.3%2F20%22%2C%0A++++++++++%22192.168.4%2F20%22%0A++++++++%5D%2C%0A++++++++%22AggPort%22%3A+%5B%0A++++++++++%22GigabitEthernet+1%2F1%2F10.1003%22%2C%0A++++++++++%22GigabitEthernet+1%2F1%2F10.1004%22%0A++++++++%5D%0A++++++%7D%2C%0A++++++%22%5Cr%5Cn%22%2C%0A++++++%22%5Cr%5Cn%22%0A++++%5D%0A++%7D%0A%7D'
   50     2        SEND_VAL                                                 <true>
    3     3        DO_ICALL                                         $7      
          4        ASSIGN                                                   !0, $7
   52     5        FETCH_DIM_R                                      ~9      !0, 'ServiceList'
          6        FETCH_DIM_R                                      ~10     ~9, 'ServiceDetail'
          7      > FE_RESET_R                                       $11     ~10, ->33
          8    > > FE_FETCH_R                                               $11, !1, ->33
   53     9    >   TYPE_CHECK                                  128          !1
         10      > JMPZ                                                     ~12, ->32
   54    11    >   FETCH_DIM_R                                      ~13     !1, 'Service_name'
         12      > FE_RESET_R                                       $14     ~13, ->31
         13    > > FE_FETCH_R                                       ~15     $14, !2, ->31
         14    >   ASSIGN                                                   !3, ~15
   55    15        FETCH_DIM_R                                      ~17     !1, 'AVLAN'
         16        FETCH_DIM_R                                      ~18     ~17, !3
         17        ASSIGN                                                   !4, ~18
   56    18        FETCH_DIM_R                                      ~20     !1, 'IpAddress'
         19        FETCH_DIM_R                                      ~21     ~20, !3
         20        ASSIGN                                                   !5, ~21
   57    21        FETCH_DIM_R                                      ~23     !1, 'AggPort'
         22        FETCH_DIM_R                                      ~24     ~23, !3
         23        ASSIGN                                                   !6, ~24
   59    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !2
         26        SEND_VAR                                                 !4
         27        SEND_VAR                                                 !5
         28        SEND_VAR                                                 !6
         29        DO_ICALL                                                 
   54    30      > JMP                                                      ->13
         31    >   FE_FREE                                                  $14
   52    32    > > JMP                                                      ->8
         33    >   FE_FREE                                                  $11
   62    34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.14 ms | 1016 KiB | 15 Q