3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = new SimpleXMLElement( '<person> <child role="son"> <child role="daughter"/> </child> <child role="daughter"> <child role="son"> <child role="son"/> </child> </child> </person>'); foreach ($xml->children() as $second_gen) { echo ' The person begot a ' . $second_gen['role']; foreach ($second_gen->children() as $third_gen) { echo ' who begot a ' . $third_gen['role'] . ';'; foreach ($third_gen->children() as $fourth_gen) { echo ' and that ' . $third_gen['role'] . ' begot a ' . $fourth_gen['role']; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 34
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 34
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 32
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 32
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 30
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 30
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 30
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 32
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/9H53B
function name:  (null)
number of ops:  36
compiled vars:  !0 = $xml, !1 = $second_gen, !2 = $third_gen, !3 = $fourth_gen
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $4      'SimpleXMLElement'
    3     1        SEND_VAL_EX                                              '%3Cperson%3E%0A+%3Cchild+role%3D%22son%22%3E%0A++%3Cchild+role%3D%22daughter%22%2F%3E%0A+%3C%2Fchild%3E%0A+%3Cchild+role%3D%22daughter%22%3E%0A++%3Cchild+role%3D%22son%22%3E%0A+++%3Cchild+role%3D%22son%22%2F%3E%0A++%3C%2Fchild%3E%0A+%3C%2Fchild%3E%0A%3C%2Fperson%3E'
          2        DO_FCALL                                      0          
    2     3        ASSIGN                                                   !0, $4
   14     4        INIT_METHOD_CALL                                         !0, 'children'
          5        DO_FCALL                                      0  $7      
          6      > FE_RESET_R                                       $8      $7, ->34
          7    > > FE_FETCH_R                                               $8, !1, ->34
   15     8    >   FETCH_DIM_R                                      ~9      !1, 'role'
          9        CONCAT                                           ~10     '+The+person+begot+a+', ~9
         10        ECHO                                                     ~10
   17    11        INIT_METHOD_CALL                                         !1, 'children'
         12        DO_FCALL                                      0  $11     
         13      > FE_RESET_R                                       $12     $11, ->32
         14    > > FE_FETCH_R                                               $12, !2, ->32
   18    15    >   FETCH_DIM_R                                      ~13     !2, 'role'
         16        CONCAT                                           ~14     '+who+begot+a+', ~13
         17        CONCAT                                           ~15     ~14, '%3B'
         18        ECHO                                                     ~15
   20    19        INIT_METHOD_CALL                                         !2, 'children'
         20        DO_FCALL                                      0  $16     
         21      > FE_RESET_R                                       $17     $16, ->30
         22    > > FE_FETCH_R                                               $17, !3, ->30
   21    23    >   FETCH_DIM_R                                      ~18     !2, 'role'
         24        CONCAT                                           ~19     '+and+that+', ~18
   22    25        CONCAT                                           ~20     ~19, '+begot+a+'
         26        FETCH_DIM_R                                      ~21     !3, 'role'
         27        CONCAT                                           ~22     ~20, ~21
         28        ECHO                                                     ~22
   20    29      > JMP                                                      ->22
         30    >   FE_FREE                                                  $17
   17    31      > JMP                                                      ->14
         32    >   FE_FREE                                                  $12
   14    33      > JMP                                                      ->7
         34    >   FE_FREE                                                  $8
   25    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.3 ms | 1399 KiB | 13 Q