3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<!DOCTYPE html> <html> <head> <title>Title of the document</title> </head> <body> <table id="mainTable"> <tr> <td>a</td> </tr> </table> </body> </html>'; $dom = new DOMDocument(); $dom->loadHTML($html); $table = $dom->getElementById('mainTable'); $rowArr = $table->getElementsByTagName('tr'); var_dump($rowArr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vo6ZE
function name:  (null)
number of ops:  19
compiled vars:  !0 = $html, !1 = $dom, !2 = $table, !3 = $rowArr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A%3Chead%3E%0A%3Ctitle%3ETitle+of+the+document%3C%2Ftitle%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%3Ctable+id%3D%22mainTable%22%3E%0A%3Ctr%3E%0A%3Ctd%3Ea%3C%2Ftd%3E%0A%3C%2Ftr%3E%0A%3C%2Ftable%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   15     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
   16     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   17     7        INIT_METHOD_CALL                                         !1, 'getElementById'
          8        SEND_VAL_EX                                              'mainTable'
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !2, $9
   18    11        INIT_METHOD_CALL                                         !2, 'getElementsByTagName'
         12        SEND_VAL_EX                                              'tr'
         13        DO_FCALL                                      0  $11     
         14        ASSIGN                                                   !3, $11
   19    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.67 ms | 1395 KiB | 15 Q