3v4l.org

run code in 300+ PHP versions simultaneously
<?php function nodelist() { return '<table id="foobar"> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> <tr> <td>4</td> <td>5</td> <td>6</td> </tr> <tr> <td>7</td> <td>8</td> <td>9</td> </tr> </table>'; } $dom = new DOMDocument('1.0', 'UTF-8'); $dom->loadHTML(nodelist()); $finder = new DomXPath($dom); $tr = $finder->query("//tr"); echo get_class($tr) . "<br />"; echo get_class($tr->item(0));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UQPvQ
function name:  (null)
number of ops:  27
compiled vars:  !0 = $dom, !1 = $finder, !2 = $tr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $3      'DOMDocument'
          1        SEND_VAL_EX                                              '1.0'
          2        SEND_VAL_EX                                              'UTF-8'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   26     5        INIT_METHOD_CALL                                         !0, 'loadHTML'
          6        INIT_FCALL                                               'nodelist'
          7        DO_FCALL                                      0  $6      
          8        SEND_VAR_NO_REF_EX                                       $6
          9        DO_FCALL                                      0          
   27    10        NEW                                              $8      'DomXPath'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !1, $8
   29    14        INIT_METHOD_CALL                                         !1, 'query'
         15        SEND_VAL_EX                                              '%2F%2Ftr'
         16        DO_FCALL                                      0  $11     
         17        ASSIGN                                                   !2, $11
   31    18        GET_CLASS                                        ~13     !2
         19        CONCAT                                           ~14     ~13, '%3Cbr+%2F%3E'
         20        ECHO                                                     ~14
   32    21        INIT_METHOD_CALL                                         !2, 'item'
         22        SEND_VAL_EX                                              0
         23        DO_FCALL                                      0  $15     
         24        GET_CLASS                                        ~16     $15
         25        ECHO                                                     ~16
         26      > RETURN                                                   1

Function nodelist:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UQPvQ
function name:  nodelist
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   '%3Ctable+id%3D%22foobar%22%3E%0A++++++++++++++++%3Ctr%3E%0A++++++++++++++++++++%3Ctd%3E1%3C%2Ftd%3E%0A++++++++++++++++++++%3Ctd%3E2%3C%2Ftd%3E%0A++++++++++++++++++++%3Ctd%3E3%3C%2Ftd%3E%0A++++++++++++++++%3C%2Ftr%3E%0A++++++++++++++++%3Ctr%3E%0A++++++++++++++++++++%3Ctd%3E4%3C%2Ftd%3E%0A++++++++++++++++++++%3Ctd%3E5%3C%2Ftd%3E%0A++++++++++++++++++++%3Ctd%3E6%3C%2Ftd%3E%0A++++++++++++++++%3C%2Ftr%3E%0A++++++++++++++++%3Ctr%3E%0A++++++++++++++++++++%3Ctd%3E7%3C%2Ftd%3E%0A++++++++++++++++++++%3Ctd%3E8%3C%2Ftd%3E%0A++++++++++++++++++++%3Ctd%3E9%3C%2Ftd%3E%0A++++++++++++++++%3C%2Ftr%3E%0A++++++++++++%3C%2Ftable%3E'
   22     1*     > RETURN                                                   null

End of function nodelist

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.29 ms | 1399 KiB | 14 Q