3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = ' <html> <head> <title>DOMDocument test-case</title> </head> <body> <div class="dummy-container"> <h1 _ngcontent-c0="" class="br-hdng"><span _ngcontent-c0="" class="pr dib">hair fall shamboo<!----></span></h1> </div> </body>'; $dom = new DOMDocument; $oldSetting = libxml_use_internal_errors(true); $dom->loadHTML( $html ); libxml_use_internal_errors($oldSetting); $xpath = new DOMXPath( $dom ); $title = $xpath->query( '//h1[@class="br-hdng"]/span' )->item( 0 )->nodeValue; echo $title;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2fCTT
function name:  (null)
number of ops:  28
compiled vars:  !0 = $html, !1 = $dom, !2 = $oldSetting, !3 = $xpath, !4 = $title
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%0A%3Chtml%3E%0A%3Chead%3E%0A++%3Ctitle%3EDOMDocument+test-case%3C%2Ftitle%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A++%3Cdiv+class%3D%22dummy-container%22%3E%0A++++%3Ch1+_ngcontent-c0%3D%22%22+class%3D%22br-hdng%22%3E%3Cspan+_ngcontent-c0%3D%22%22+class%3D%22pr+dib%22%3Ehair+fall+shamboo%3C%21----%3E%3C%2Fspan%3E%3C%2Fh1%3E%0A++%3C%2Fdiv%3E%0A%3C%2Fbody%3E'
   14     1        NEW                                              $6      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
   16     4        INIT_FCALL                                               'libxml_use_internal_errors'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !2, $9
   17     8        INIT_METHOD_CALL                                         !1, 'loadHTML'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
   18    11        INIT_FCALL                                               'libxml_use_internal_errors'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
   20    14        NEW                                              $13     'DOMXPath'
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !3, $13
   21    18        INIT_METHOD_CALL                                         !3, 'query'
         19        SEND_VAL_EX                                              '%2F%2Fh1%5B%40class%3D%22br-hdng%22%5D%2Fspan'
         20        DO_FCALL                                      0  $16     
         21        INIT_METHOD_CALL                                         $16, 'item'
         22        SEND_VAL_EX                                              0
         23        DO_FCALL                                      0  $17     
         24        FETCH_OBJ_R                                      ~18     $17, 'nodeValue'
         25        ASSIGN                                                   !4, ~18
   22    26        ECHO                                                     !4
   23    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.96 ms | 1452 KiB | 14 Q