3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = '<?xml version="1.0" encoding="utf-8" ?> <note> <to> <form>pswA</form> <heading>A</heading> </to> <to> <form>pswB</form> <heading>A</heading> </to> </note>'; $xml = simplexml_load_string($data); foreach ($xml->to as $to){ if ($to->form == 'pswA' && $to->heading == 'A'){echo "allow";} elseif ($to->form == 'pswA' && $to->heading == 'B'){echo "notallow";} elseif ($to->form == 'pswA' && $to->heading == 'C'){echo "block";} } ob_start(); foreach ($xml->to as $to){ if ($to->form == 'pswA' && $to->heading == 'A') echo "allow"; elseif ($to->form == 'pswC' && $to->heading == 'B') echo "notallow"; elseif ($to->form == 'pswC' && $to->heading == 'C') echo "block"; } if(!ob_get_contents()) echo "empty"; ob_end_flush(); ?>
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 = 40, Position 2 = 68
Branch analysis from position: 40
2 jumps found. (Code = 78) Position 1 = 41, Position 2 = 68
Branch analysis from position: 41
2 jumps found. (Code = 46) Position 1 = 44, Position 2 = 47
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 50
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
Branch analysis from position: 50
2 jumps found. (Code = 46) Position 1 = 53, Position 2 = 56
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 59
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
Branch analysis from position: 59
2 jumps found. (Code = 46) Position 1 = 62, Position 2 = 65
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 67
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
Branch analysis from position: 67
Branch analysis from position: 65
Branch analysis from position: 56
Branch analysis from position: 47
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 73, Position 2 = 74
Branch analysis from position: 73
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 74
Branch analysis from position: 68
Branch analysis from position: 35
filename:       /in/sErsY
function name:  (null)
number of ops:  77
compiled vars:  !0 = $data, !1 = $xml, !2 = $to
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22+%3F%3E%0A%3Cnote%3E%0A++%3Cto%3E%0A++++%3Cform%3EpswA%3C%2Fform%3E%0A++++%3Cheading%3EA%3C%2Fheading%3E%0A++%3C%2Fto%3E%0A++%3Cto%3E%0A++++%3Cform%3EpswB%3C%2Fform%3E%0A++++%3Cheading%3EA%3C%2Fheading%3E%0A++%3C%2Fto%3E%0A%3C%2Fnote%3E'
   14     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   15     5        FETCH_OBJ_R                                      ~6      !1, 'to'
          6      > FE_RESET_R                                       $7      ~6, ->35
          7    > > FE_FETCH_R                                               $7, !2, ->35
   16     8    >   FETCH_OBJ_R                                      ~8      !2, 'form'
          9        IS_EQUAL                                         ~9      ~8, 'pswA'
         10      > JMPZ_EX                                          ~9      ~9, ->14
         11    >   FETCH_OBJ_R                                      ~10     !2, 'heading'
         12        IS_EQUAL                                         ~11     ~10, 'A'
         13        BOOL                                             ~9      ~11
         14    > > JMPZ                                                     ~9, ->17
         15    >   ECHO                                                     'allow'
         16      > JMP                                                      ->34
   17    17    >   FETCH_OBJ_R                                      ~12     !2, 'form'
         18        IS_EQUAL                                         ~13     ~12, 'pswA'
         19      > JMPZ_EX                                          ~13     ~13, ->23
         20    >   FETCH_OBJ_R                                      ~14     !2, 'heading'
         21        IS_EQUAL                                         ~15     ~14, 'B'
         22        BOOL                                             ~13     ~15
         23    > > JMPZ                                                     ~13, ->26
         24    >   ECHO                                                     'notallow'
         25      > JMP                                                      ->34
   18    26    >   FETCH_OBJ_R                                      ~16     !2, 'form'
         27        IS_EQUAL                                         ~17     ~16, 'pswA'
         28      > JMPZ_EX                                          ~17     ~17, ->32
         29    >   FETCH_OBJ_R                                      ~18     !2, 'heading'
         30        IS_EQUAL                                         ~19     ~18, 'C'
         31        BOOL                                             ~17     ~19
         32    > > JMPZ                                                     ~17, ->34
         33    >   ECHO                                                     'block'
   15    34    > > JMP                                                      ->7
         35    >   FE_FREE                                                  $7
   21    36        INIT_FCALL                                               'ob_start'
         37        DO_ICALL                                                 
   22    38        FETCH_OBJ_R                                      ~21     !1, 'to'
         39      > FE_RESET_R                                       $22     ~21, ->68
         40    > > FE_FETCH_R                                               $22, !2, ->68
   23    41    >   FETCH_OBJ_R                                      ~23     !2, 'form'
         42        IS_EQUAL                                         ~24     ~23, 'pswA'
         43      > JMPZ_EX                                          ~24     ~24, ->47
         44    >   FETCH_OBJ_R                                      ~25     !2, 'heading'
         45        IS_EQUAL                                         ~26     ~25, 'A'
         46        BOOL                                             ~24     ~26
         47    > > JMPZ                                                     ~24, ->50
         48    >   ECHO                                                     'allow'
         49      > JMP                                                      ->67
   24    50    >   FETCH_OBJ_R                                      ~27     !2, 'form'
         51        IS_EQUAL                                         ~28     ~27, 'pswC'
         52      > JMPZ_EX                                          ~28     ~28, ->56
         53    >   FETCH_OBJ_R                                      ~29     !2, 'heading'
         54        IS_EQUAL                                         ~30     ~29, 'B'
         55        BOOL                                             ~28     ~30
         56    > > JMPZ                                                     ~28, ->59
         57    >   ECHO                                                     'notallow'
         58      > JMP                                                      ->67
   25    59    >   FETCH_OBJ_R                                      ~31     !2, 'form'
         60        IS_EQUAL                                         ~32     ~31, 'pswC'
         61      > JMPZ_EX                                          ~32     ~32, ->65
         62    >   FETCH_OBJ_R                                      ~33     !2, 'heading'
         63        IS_EQUAL                                         ~34     ~33, 'C'
         64        BOOL                                             ~32     ~34
         65    > > JMPZ                                                     ~32, ->67
         66    >   ECHO                                                     'block'
   22    67    > > JMP                                                      ->40
         68    >   FE_FREE                                                  $22
   27    69        INIT_FCALL                                               'ob_get_contents'
         70        DO_ICALL                                         $35     
         71        BOOL_NOT                                         ~36     $35
         72      > JMPZ                                                     ~36, ->74
         73    >   ECHO                                                     'empty'
   28    74    >   INIT_FCALL                                               'ob_end_flush'
         75        DO_ICALL                                                 
   29    76      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.09 ms | 1404 KiB | 21 Q