3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data='<data> <seg id="A1"/> <seg id="A5"/> <seg id="A12"/> <seg id="A29"/> <seg id="A30"/> </data>'; $doc=new SimpleXMLElement($data); var_dump($doc); foreach($doc->seg as &$seg) { if($seg['id'] == 'A12') { unset($seg); } } var_dump($seg);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
2 jumps found. (Code = 126) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/6lHoL
function name:  (null)
number of ops:  21
compiled vars:  !0 = $data, !1 = $doc, !2 = $seg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cdata%3E%0A++++%3Cseg+id%3D%22A1%22%2F%3E%0A++++%3Cseg+id%3D%22A5%22%2F%3E%0A++++%3Cseg+id%3D%22A12%22%2F%3E%0A++++%3Cseg+id%3D%22A29%22%2F%3E%0A++++%3Cseg+id%3D%22A30%22%2F%3E%0A%3C%2Fdata%3E'
   10     1        NEW                                              $4      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   12     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
   14     8        FETCH_OBJ_W                                      $8      !1, 'seg'
          9      > FE_RESET_RW                                      $9      $8, ->16
         10    > > FE_FETCH_RW                                              $9, !2, ->16
   16    11    >   FETCH_DIM_R                                      ~10     !2, 'id'
         12        IS_EQUAL                                                 ~10, 'A12'
         13      > JMPZ                                                     ~11, ->15
   18    14    >   UNSET_CV                                                 !2
   14    15    > > JMP                                                      ->10
         16    >   FE_FREE                                                  $9
   22    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.98 ms | 1395 KiB | 15 Q