3v4l.org

run code in 300+ PHP versions simultaneously
<?php function pr($s) { return '<xmp>'.print_r($s,true).'</xmp>' ; } global $pippo; $file = 'http://www.dominioinventatoacaso.com/somefile.jpg'; $doc = '<root><element att="uno"><sotto>Ciao</sotto><sotto>Mamma</sotto></element></root>' ; $s = new SimpleXMLElement($doc) ; $x = $s->children()[0] ; echo "prima\n" ; echo pr($x->children()['element']) ; echo "dopo\n" ;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ED2gl
function name:  (null)
number of ops:  21
compiled vars:  !0 = $pippo, !1 = $file, !2 = $doc, !3 = $s, !4 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_GLOBAL                                              !0, 'pippo'
    9     1        ASSIGN                                                   !1, 'http%3A%2F%2Fwww.dominioinventatoacaso.com%2Fsomefile.jpg'
   10     2        ASSIGN                                                   !2, '%3Croot%3E%3Celement+att%3D%22uno%22%3E%3Csotto%3ECiao%3C%2Fsotto%3E%3Csotto%3EMamma%3C%2Fsotto%3E%3C%2Felement%3E%3C%2Froot%3E'
   11     3        NEW                                              $7      'SimpleXMLElement'
          4        SEND_VAR_EX                                              !2
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !3, $7
   12     7        INIT_METHOD_CALL                                         !3, 'children'
          8        DO_FCALL                                      0  $10     
          9        FETCH_DIM_R                                      ~11     $10, 0
         10        ASSIGN                                                   !4, ~11
   13    11        ECHO                                                     'prima%0A'
   14    12        INIT_FCALL                                               'pr'
         13        INIT_METHOD_CALL                                         !4, 'children'
         14        DO_FCALL                                      0  $13     
         15        FETCH_DIM_R                                      ~14     $13, 'element'
         16        SEND_VAL                                                 ~14
         17        DO_FCALL                                      0  $15     
         18        ECHO                                                     $15
   15    19        ECHO                                                     'dopo%0A'
         20      > RETURN                                                   1

Function pr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ED2gl
function name:  pr
number of ops:  9
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'print_r'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $1      
          5        CONCAT                                           ~2      '%3Cxmp%3E', $1
          6        CONCAT                                           ~3      ~2, '%3C%2Fxmp%3E'
          7      > RETURN                                                   ~3
    5     8*     > RETURN                                                   null

End of function pr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.52 ms | 1390 KiB | 16 Q