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); var_dump($obj->firstChild()->firstChild()->firstChild()[1]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ShGts
function name:  (null)
number of ops:  16
compiled vars:  !0 = $s, !1 = $obj
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                                              $3      'MyXML'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
   36     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !1, 'firstChild'
          7        DO_FCALL                                      0  $6      
          8        INIT_METHOD_CALL                                         $6, 'firstChild'
          9        DO_FCALL                                      0  $7      
         10        INIT_METHOD_CALL                                         $7, 'firstChild'
         11        DO_FCALL                                      0  $8      
         12        FETCH_DIM_R                                      ~9      $8, 1
         13        SEND_VAL                                                 ~9
         14        DO_ICALL                                                 
         15      > 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/ShGts
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/ShGts
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:
152.98 ms | 1400 KiB | 15 Q