3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<EOF <people> <person name="Person 1"> <child/> <child/> <child/> </person> <person name="Person 2"> <child/> <child/> <child/> <child/> <child/> </person> </people> EOF; $elem = new SimpleXMLElement($xml); foreach ($elem as $person) { printf("%s has got %d children.\n", $person['name'], $person->count()); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 16
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/Q9Tih
function name:  (null)
number of ops:  18
compiled vars:  !0 = $xml, !1 = $elem, !2 = $person
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cpeople%3E%0A+%3Cperson+name%3D%22Person+1%22%3E%0A++%3Cchild%2F%3E%0A++%3Cchild%2F%3E%0A++%3Cchild%2F%3E%0A+%3C%2Fperson%3E%0A+%3Cperson+name%3D%22Person+2%22%3E%0A++%3Cchild%2F%3E%0A++%3Cchild%2F%3E%0A++%3Cchild%2F%3E%0A++%3Cchild%2F%3E%0A++%3Cchild%2F%3E%0A+%3C%2Fperson%3E%0A%3C%2Fpeople%3E'
   19     1        NEW                                              $4      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   21     5      > FE_RESET_R                                       $7      !1, ->16
          6    > > FE_FETCH_R                                               $7, !2, ->16
   22     7    >   INIT_FCALL                                               'printf'
          8        SEND_VAL                                                 '%25s+has+got+%25d+children.%0A'
          9        FETCH_DIM_R                                      ~8      !2, 'name'
         10        SEND_VAL                                                 ~8
         11        INIT_METHOD_CALL                                         !2, 'count'
         12        DO_FCALL                                      0  $9      
         13        SEND_VAR                                                 $9
         14        DO_ICALL                                                 
   21    15      > JMP                                                      ->6
         16    >   FE_FREE                                                  $7
   24    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.97 ms | 1395 KiB | 15 Q