3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '<div> <div id="priceRangeWrapper"> <div id="priceSlider" min="110" max="650"></div> </div> </div>'; $doc = new DOMDocument(); $doc->loadHTML( $str); // Load the HTML string from your post $xpath = new DOMXPath( $doc); $node = $xpath->query( '//div[@id="priceSlider"]')->item(0); // Get the <div> echo $node->getAttribute('min') . " " . $node->getAttribute('max');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4XKhh
function name:  (null)
number of ops:  28
compiled vars:  !0 = $str, !1 = $doc, !2 = $xpath, !3 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cdiv%3E%0A+++++++++++%3Cdiv+id%3D%22priceRangeWrapper%22%3E%0A++++++++++++++%3Cdiv+id%3D%22priceSlider%22+min%3D%22110%22+max%3D%22650%22%3E%3C%2Fdiv%3E%0A+++++++++++%3C%2Fdiv%3E%0A++++++++%3C%2Fdiv%3E'
    8     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
    9     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   11     7        NEW                                              $9      'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $9
   12    11        INIT_METHOD_CALL                                         !2, 'query'
         12        SEND_VAL_EX                                              '%2F%2Fdiv%5B%40id%3D%22priceSlider%22%5D'
         13        DO_FCALL                                      0  $12     
         14        INIT_METHOD_CALL                                         $12, 'item'
         15        SEND_VAL_EX                                              0
         16        DO_FCALL                                      0  $13     
         17        ASSIGN                                                   !3, $13
   14    18        INIT_METHOD_CALL                                         !3, 'getAttribute'
         19        SEND_VAL_EX                                              'min'
         20        DO_FCALL                                      0  $15     
         21        CONCAT                                           ~16     $15, '+'
         22        INIT_METHOD_CALL                                         !3, 'getAttribute'
         23        SEND_VAL_EX                                              'max'
         24        DO_FCALL                                      0  $17     
         25        CONCAT                                           ~18     ~16, $17
         26        ECHO                                                     ~18
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.89 ms | 1434 KiB | 13 Q