3v4l.org

run code in 300+ PHP versions simultaneously
<?php $header_nodes = (new DOMXPath( (new DOMDocument())->loadHTML( '<?xml version="1.0" encoding="UTF-8"?>'.'<h2>asdf</h2>' ) ))->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/CUGvk
function name:  (null)
number of ops:  17
compiled vars:  !0 = $header_nodes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'DOMXPath'
    4     1        NEW                                              $2      'DOMDocument'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $2, 'loadHTML'
    5     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  $4      
          6        SEND_VAR_NO_REF_EX                                       $4
          7        DO_FCALL                                      0          
    7     8        INIT_METHOD_CALL                                         $1, 'query'
          9        SEND_VAL_EX                                              '%2F%2F%2A%5Bself%3A%3Ah2+or+self%3A%3Ah3%5D'
         10        DO_FCALL                                      0  $6      
    3    11        ASSIGN                                                   !0, $6
    8    12        INIT_FCALL                                               'var_dump'
         13        FETCH_OBJ_R                                      ~8      !0, 'length'
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.86 ms | 1394 KiB | 15 Q