3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A extends SimpleXMLElement { } $delimiter = "--------------------------------------------------------------------------------\n"; echo $delimiter; $xml1 = <<<XML <?xml version="1.0"?> <a> <b> <c> <value attr="Some Attr">Some Value</value> </c> </b> </a> XML; $a1 = new A($xml1); foreach ($a1->b->c->children() as $key => $value) { var_dump($value); } echo $delimiter; $xml2 = <<<XML <?xml version="1.0"?> <a> <b> <c><value attr="Some Attr">Some Value</value></c> </b> </a> XML; $a2 = new A($xml2); foreach ($a2->b->c->children() as $key => $value) { var_dump($value); } echo $delimiter;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 30, Position 2 = 36
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 36
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
Branch analysis from position: 18
filename:       /in/XTebW
function name:  (null)
number of ops:  39
compiled vars:  !0 = $delimiter, !1 = $xml1, !2 = $a1, !3 = $value, !4 = $key, !5 = $xml2, !6 = $a2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, '--------------------------------------------------------------------------------%0A'
    8     1        ECHO                                                     !0
   10     2        ASSIGN                                                   !1, '%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Ca%3E%0A++++%3Cb%3E%0A++++++++%3Cc%3E%0A++++++++++++%3Cvalue+attr%3D%22Some+Attr%22%3ESome+Value%3C%2Fvalue%3E%0A++++++++%3C%2Fc%3E%0A++++%3C%2Fb%3E%0A%3C%2Fa%3E'
   21     3        NEW                                              $9      'A'
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !2, $9
   23     7        FETCH_OBJ_R                                      ~12     !2, 'b'
          8        FETCH_OBJ_R                                      ~13     ~12, 'c'
          9        INIT_METHOD_CALL                                         ~13, 'children'
         10        DO_FCALL                                      0  $14     
         11      > FE_RESET_R                                       $15     $14, ->18
         12    > > FE_FETCH_R                                       ~16     $15, !3, ->18
         13    >   ASSIGN                                                   !4, ~16
   24    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                                 
   23    17      > JMP                                                      ->12
         18    >   FE_FREE                                                  $15
   27    19        ECHO                                                     !0
   29    20        ASSIGN                                                   !5, '%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Ca%3E%0A++++%3Cb%3E%0A++++++++%3Cc%3E%3Cvalue+attr%3D%22Some+Attr%22%3ESome+Value%3C%2Fvalue%3E%3C%2Fc%3E%0A++++%3C%2Fb%3E%0A%3C%2Fa%3E'
   38    21        NEW                                              $20     'A'
         22        SEND_VAR_EX                                              !5
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !6, $20
   40    25        FETCH_OBJ_R                                      ~23     !6, 'b'
         26        FETCH_OBJ_R                                      ~24     ~23, 'c'
         27        INIT_METHOD_CALL                                         ~24, 'children'
         28        DO_FCALL                                      0  $25     
         29      > FE_RESET_R                                       $26     $25, ->36
         30    > > FE_FETCH_R                                       ~27     $26, !3, ->36
         31    >   ASSIGN                                                   !4, ~27
   41    32        INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !3
         34        DO_ICALL                                                 
   40    35      > JMP                                                      ->30
         36    >   FE_FREE                                                  $26
   44    37        ECHO                                                     !0
         38      > RETURN                                                   1

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140 ms | 1400 KiB | 15 Q