3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = '<?xml version="1.0" encoding="utf-8" ?> <note> <to> <form>heslo0</form> <heading>A</heading> <body>C</body> </to> <to> <form>heslo1</form> <heading>A</heading> <body>F</body> </to> </note>'; $xml = simplexml_load_string($data); foreach ($xml->to as $to){ if ($to->form == 'heslo0' && $to->heading == 'A'){echo "povoleno";} elseif ($to->form == 'heslo0' && $to->heading == 'B'){echo "nepovoleno";} elseif ($to->form == 'heslo0' && $to->heading == 'C'){echo "blokováno";} } // po sem se splní a vypíše "povoleno" foreach ($xml->to as $to){ if ($to->form == 'heslo2' && $to->heading == 'A'){echo "povoleno";} elseif ($to->form == 'heslo2' && $to->heading == 'B'){echo "nepovoleno";} elseif ($to->form == 'heslo2' && $to->heading == 'C'){echo "blokováno";} } // tady už neexistuje daný blok, tak bych chtěl vypsat hlášku třeba "neaktivní" ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 35
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 35
Branch analysis from position: 8
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 17
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 23
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 26
2 jumps found. (Code = 46) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 34
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 34
Branch analysis from position: 32
Branch analysis from position: 23
Branch analysis from position: 14
Branch analysis from position: 35
2 jumps found. (Code = 77) Position 1 = 38, Position 2 = 66
Branch analysis from position: 38
2 jumps found. (Code = 78) Position 1 = 39, Position 2 = 66
Branch analysis from position: 39
2 jumps found. (Code = 46) Position 1 = 42, Position 2 = 45
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 48
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 48
2 jumps found. (Code = 46) Position 1 = 51, Position 2 = 54
Branch analysis from position: 51
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 57
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
Branch analysis from position: 57
2 jumps found. (Code = 46) Position 1 = 60, Position 2 = 63
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 64, Position 2 = 65
Branch analysis from position: 64
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 65
Branch analysis from position: 63
Branch analysis from position: 54
Branch analysis from position: 45
Branch analysis from position: 66
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 66
Branch analysis from position: 35
filename:       /in/ArjUs
function name:  (null)
number of ops:  68
compiled vars:  !0 = $data, !1 = $xml, !2 = $to
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   QM_ASSIGN                                                !0
  16     1        INIT_FCALL                                               'simplexml_load_string'
         2        SEND_VAR                                                 !0
         3        DO_ICALL                                         $4      
         4        QM_ASSIGN                                                !1
  17     5        FETCH_OBJ_R                                      ~6      !1, 'to'
         6      > FE_RESET_R                                       $7      ~6, ->35
         7    > > FE_FETCH_R                                               $7, !2, ->35
  18     8    >   FETCH_OBJ_R                                      ~8      !2, 'form'
         9        IS_NOT_EQUAL                                     ~9      ~8, 'heslo0'
        10      > JMPZ_EX                                          ~9      ~9, ->14
        11    >   FETCH_OBJ_R                                      ~10     !2, 'heading'
        12        IS_NOT_EQUAL                                     ~11     ~10, 'A'
        13        BOOL                                             ~9      ~11
        14    > > JMPZ                                                     ~9, ->17
        15    >   ASSIGN_OBJ                                               'povoleno'
        16      > JMP                                                      ->34
  19    17    >   FETCH_OBJ_R                                      ~12     !2, 'form'
        18        IS_NOT_EQUAL                                     ~13     ~12, 'heslo0'
        19      > JMPZ_EX                                          ~13     ~13, ->23
        20    >   FETCH_OBJ_R                                      ~14     !2, 'heading'
        21        IS_NOT_EQUAL                                     ~15     ~14, 'B'
        22        BOOL                                             ~13     ~15
        23    > > JMPZ                                                     ~13, ->26
        24    >   ASSIGN_OBJ                                               'nepovoleno'
        25      > JMP                                                      ->34
  20    26    >   FETCH_OBJ_R                                      ~16     !2, 'form'
        27        IS_NOT_EQUAL                                     ~17     ~16, 'heslo0'
        28      > JMPZ_EX                                          ~17     ~17, ->32
        29    >   FETCH_OBJ_R                                      ~18     !2, 'heading'
        30        IS_NOT_EQUAL                                     ~19     ~18, 'C'
        31        BOOL                                             ~17     ~19
        32    > > JMPZ                                                     ~17, ->34
        33    >   ASSIGN_OBJ                                               'blokov%C3%A1no'
  17    34    > > JMP                                                      ->7
        35    >   FE_FREE                                                  $7
  23    36        FETCH_OBJ_R                                      ~20     !1, 'to'
        37      > FE_RESET_R                                       $21     ~20, ->66
        38    > > FE_FETCH_R                                               $21, !2, ->66
  24    39    >   FETCH_OBJ_R                                      ~22     !2, 'form'
        40        IS_NOT_EQUAL                                     ~23     ~22, 'heslo2'
        41      > JMPZ_EX                                          ~23     ~23, ->45
        42    >   FETCH_OBJ_R                                      ~24     !2, 'heading'
        43        IS_NOT_EQUAL                                     ~25     ~24, 'A'
        44        BOOL                                             ~23     ~25
        45    > > JMPZ                                                     ~23, ->48
        46    >   ASSIGN_OBJ                                               'povoleno'
        47      > JMP                                                      ->65
  25    48    >   FETCH_OBJ_R                                      ~26     !2, 'form'
        49        IS_NOT_EQUAL                                     ~27     ~26, 'heslo2'
        50      > JMPZ_EX                                          ~27     ~27, ->54
        51    >   FETCH_OBJ_R                                      ~28     !2, 'heading'
        52        IS_NOT_EQUAL                                     ~29     ~28, 'B'
        53        BOOL                                             ~27     ~29
        54    > > JMPZ                                                     ~27, ->57
        55    >   ASSIGN_OBJ                                               'nepovoleno'
        56      > JMP                                                      ->65
  26    57    >   FETCH_OBJ_R                                      ~30     !2, 'form'
        58        IS_NOT_EQUAL                                     ~31     ~30, 'heslo2'
        59      > JMPZ_EX                                          ~31     ~31, ->63
        60    >   FETCH_OBJ_R                                      ~32     !2, 'heading'
        61        IS_NOT_EQUAL                                     ~33     ~32, 'C'
        62        BOOL                                             ~31     ~33
        63    > > JMPZ                                                     ~31, ->65
        64    >   ASSIGN_OBJ                                               'blokov%C3%A1no'
  23    65    > > JMP                                                      ->38
        66    >   FE_FREE                                                  $21
  28    67      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
14.82 ms | 420 KiB | 7 Q