3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<STR <div class="smalldesc"> <div itemprop="datePublished" class="date">Kamis, 25 Mei 2017 | 14:49 WIB</div> <div itemprop="author" itemscope itemtype="http://schema.org/Person" class="author">Oleh : <b></b><b>...</b></div> </div> STR; $dom = new DOMDocument(); $dom->loadHTML($html); $dox = new DOMXPath($dom); $dateEl = $dox->query("//div[@itemprop='datePublished'][@class='date']")->item(0); echo $dateEl->textContent; // Kamis, 25 Mei 2017 | 14:49 WIB
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IHfml
function name:  (null)
number of ops:  21
compiled vars:  !0 = $html, !1 = $dom, !2 = $dox, !3 = $dateEl
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cdiv+class%3D%22smalldesc%22%3E%0A++++%3Cdiv+itemprop%3D%22datePublished%22+class%3D%22date%22%3EKamis%2C+25+Mei+2017+%7C+14%3A49+WIB%3C%2Fdiv%3E%0A++++%3Cdiv+itemprop%3D%22author%22+itemscope+itemtype%3D%22http%3A%2F%2Fschema.org%2FPerson%22+class%3D%22author%22%3EOleh+%3A+%3Cb%3E%3C%2Fb%3E%3Cb%3E...%3C%2Fb%3E%3C%2Fdiv%3E%0A%3C%2Fdiv%3E'
   10     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
   11     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   12     7        NEW                                              $9      'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $9
   13    11        INIT_METHOD_CALL                                         !2, 'query'
         12        SEND_VAL_EX                                              '%2F%2Fdiv%5B%40itemprop%3D%27datePublished%27%5D%5B%40class%3D%27date%27%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
   15    18        FETCH_OBJ_R                                      ~15     !3, 'textContent'
         19        ECHO                                                     ~15
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.21 ms | 1002 KiB | 13 Q