3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { $d = new DOMDocument; $c = $d->createElement('foo', 'bar'); $g = $d->createElement('fiz', 'buz'); $h = $d->createElement('red', 'xen'); $c->appendChild($g); $g->appendChild($h); return $h; } $x = foo(); while ($x) { var_dump($x->nodeValue); $x = $x->parentNode; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 4
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 4
Branch analysis from position: 11
Branch analysis from position: 4
filename:       /in/bFpXs
function name:  (null)
number of ops:  12
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   16     3      > JMP                                                      ->10
   17     4    >   INIT_FCALL                                               'var_dump'
          5        FETCH_OBJ_R                                      ~3      !0, 'nodeValue'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                                 
   18     8        FETCH_OBJ_R                                      ~5      !0, 'parentNode'
          9        ASSIGN                                                   !0, ~5
   16    10    > > JMPNZ                                                    !0, ->4
   19    11    > > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bFpXs
function name:  foo
number of ops:  26
compiled vars:  !0 = $d, !1 = $c, !2 = $g, !3 = $h
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $4      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    5     3        INIT_METHOD_CALL                                         !0, 'createElement'
          4        SEND_VAL_EX                                              'foo'
          5        SEND_VAL_EX                                              'bar'
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !1, $7
    6     8        INIT_METHOD_CALL                                         !0, 'createElement'
          9        SEND_VAL_EX                                              'fiz'
         10        SEND_VAL_EX                                              'buz'
         11        DO_FCALL                                      0  $9      
         12        ASSIGN                                                   !2, $9
    7    13        INIT_METHOD_CALL                                         !0, 'createElement'
         14        SEND_VAL_EX                                              'red'
         15        SEND_VAL_EX                                              'xen'
         16        DO_FCALL                                      0  $11     
         17        ASSIGN                                                   !3, $11
    9    18        INIT_METHOD_CALL                                         !1, 'appendChild'
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0          
   10    21        INIT_METHOD_CALL                                         !2, 'appendChild'
         22        SEND_VAR_EX                                              !3
         23        DO_FCALL                                      0          
   12    24      > RETURN                                                   !3
   13    25*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.03 ms | 1394 KiB | 16 Q