3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<div class="h1">2008 Honda Accord Coupe<small> — Wuse II</small></div>'; $dom = new DomDocument(); $dom->loadHtml($html); $xpath = new DomXPath($dom); print $xpath->evaluate("string(//div[@class='h1']/text())");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/otuOK
function name:  (null)
number of ops:  16
compiled vars:  !0 = $html, !1 = $dom, !2 = $xpath
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cdiv+class%3D%22h1%22%3E2008+Honda+Accord+Coupe%3Csmall%3E+%E2%80%94+Wuse+II%3C%2Fsmall%3E%3C%2Fdiv%3E'
    4     1        NEW                                              $4      'DomDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
    5     4        INIT_METHOD_CALL                                         !1, 'loadHtml'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    6     7        NEW                                              $8      'DomXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $8
    7    11        INIT_METHOD_CALL                                         !2, 'evaluate'
         12        SEND_VAL_EX                                              'string%28%2F%2Fdiv%5B%40class%3D%27h1%27%5D%2Ftext%28%29%29'
         13        DO_FCALL                                      0  $11     
         14        ECHO                                                     $11
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.37 ms | 1393 KiB | 13 Q