3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyXML extends SimpleXMLElement { public function firstChild() { $children = $this->children(); foreach ($children as $key => $value) break; /*var_dump( $this->getName(), $key );*/ return $value; } public function t() { } } $s = '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>'. '<request>'. ' <body>'. ' <rows>'. ' <row id="1"/>'. ' <row id="2"/>'. ' <row id="3"/>'. ' <row2 ver="2.0">test data</row2>'. ' </rows>'. ' </body>'. '</request>'; $obj = new MyXML($s); $row = $obj->firstChild()->firstChild()->firstChild(); foreach ($row as $r) var_dump($r);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/2gf4b
function name:  (null)
number of ops:  20
compiled vars:  !0 = $s, !1 = $obj, !2 = $row, !3 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22+standalone%3D%22yes%22+%3F%3E%3Crequest%3E++%3Cbody%3E++++++%3Crows%3E++++++++++%3Crow+id%3D%221%22%2F%3E++++++++++%3Crow+id%3D%222%22%2F%3E++++++++++%3Crow+id%3D%223%22%2F%3E++++++++++%3Crow2+ver%3D%222.0%22%3Etest+data%3C%2Frow2%3E++++++%3C%2Frows%3E++%3C%2Fbody%3E%3C%2Frequest%3E'
   35     1        NEW                                              $5      'MyXML'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
   36     5        INIT_METHOD_CALL                                         !1, 'firstChild'
          6        DO_FCALL                                      0  $8      
          7        INIT_METHOD_CALL                                         $8, 'firstChild'
          8        DO_FCALL                                      0  $9      
          9        INIT_METHOD_CALL                                         $9, 'firstChild'
         10        DO_FCALL                                      0  $10     
         11        ASSIGN                                                   !2, $10
   38    12      > FE_RESET_R                                       $12     !2, ->18
         13    > > FE_FETCH_R                                               $12, !3, ->18
   39    14    >   INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                                 
   38    17      > JMP                                                      ->13
         18    >   FE_FREE                                                  $12
   39    19      > RETURN                                                   1

Class MyXML:
Function firstchild:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
Branch analysis from position: 8
filename:       /in/2gf4b
function name:  firstChild
number of ops:  11
compiled vars:  !0 = $children, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_METHOD_CALL                                         'children'
          1        DO_FCALL                                      0  $3      
          2        ASSIGN                                                   !0, $3
    7     3      > FE_RESET_R                                       $5      !0, ->8
          4    > > FE_FETCH_R                                       ~6      $5, !1, ->8
          5    >   ASSIGN                                                   !2, ~6
    8     6      > JMP                                                      ->8
    7     7*       JMP                                                      ->4
          8    >   FE_FREE                                                  $5
   13     9      > RETURN                                                   !1
   14    10*     > RETURN                                                   null

End of function firstchild

Function t:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2gf4b
function name:  t
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E > > RETURN                                                   null

End of function t

End of class MyXML.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.51 ms | 1392 KiB | 15 Q