3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new DOMDocument(); $dom->loadHTML('<?xml version="1.0" encoding="UTF-8"?>'.'<h2>asdf</h2>'); $header_nodes = (new DOMXPath($dom))->query('//*[self::h2 or self::h3]'); var_dump($header_nodes->length);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bne72
function name:  (null)
number of ops:  18
compiled vars:  !0 = $dom, !1 = $header_nodes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    4     3        INIT_METHOD_CALL                                         !0, 'loadHTML'
          4        SEND_VAL_EX                                              '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%3Ch2%3Easdf%3C%2Fh2%3E'
          5        DO_FCALL                                      0          
    5     6        NEW                                              $6      'DOMXPath'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
          9        INIT_METHOD_CALL                                         $6, 'query'
         10        SEND_VAL_EX                                              '%2F%2F%2A%5Bself%3A%3Ah2+or+self%3A%3Ah3%5D'
         11        DO_FCALL                                      0  $8      
         12        ASSIGN                                                   !1, $8
    6    13        INIT_FCALL                                               'var_dump'
         14        FETCH_OBJ_R                                      ~10     !1, 'length'
         15        SEND_VAL                                                 ~10
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.88 ms | 1394 KiB | 15 Q