3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <root> <table></table> <table></table> </root> XML; $doc = new DOMDOcument; $doc->loadXML($xml); $tables = $doc->getElementsByTagName('table'); var_dump($tables->length); foreach ($tables as $table) { echo "Loop\n"; $tables = 'Something else'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/9GN3G
function name:  (null)
number of ops:  22
compiled vars:  !0 = $xml, !1 = $doc, !2 = $tables, !3 = $table
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Croot%3E%0A%3Ctable%3E%3C%2Ftable%3E%0A%3Ctable%3E%3C%2Ftable%3E%0A%3C%2Froot%3E'
   10     1        NEW                                              $5      'DOMDOcument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
   11     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   13     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'table'
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !2, $9
   15    11        INIT_FCALL                                               'var_dump'
         12        FETCH_OBJ_R                                      ~11     !2, 'length'
         13        SEND_VAL                                                 ~11
         14        DO_ICALL                                                 
   17    15      > FE_RESET_R                                       $13     !2, ->20
         16    > > FE_FETCH_R                                               $13, !3, ->20
   18    17    >   ECHO                                                     'Loop%0A'
   20    18        ASSIGN                                                   !2, 'Something+else'
   17    19      > JMP                                                      ->16
         20    >   FE_FREE                                                  $13
   21    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.35 ms | 1387 KiB | 15 Q