3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new DOMDocument; $dom->loadHTML(<<<'H_T_M_L' <html><body> <div class="app_content"> <ul class="js-events-container">... <li class="single-event live">...</li> <li class="single-event live">...</li> <li class="single-event live">...</li> <li class="single-event live">...</li> <li class="single-event live"> ::before //First DIV of li <div class="single-event__code"> Event Code: <strong>96441</strong> </div> <div class="single-event__time"> <span class="score js-score">LIVE</span> <span class="time js-timer"></span> </div> <div class="single-event__players"> <a href="/sportsbook/SOCCER/BRAZIL_SERIE_D/400953/"> AA Portuguesa RJ <span> v </span> Audax SP </a> </div> <div class="single-event__bets three markets"> <div class="single-event__bets__container js-bets-container"> </body></html> H_T_M_L ); $xp = new DOMXPath($dom); $coll = $xp->query('//div[@class="single-event__code"]'); if ($coll->length) { foreach ($coll as $item) { echo $item->nodeValue, "\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 23
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 23
filename:       /in/oEbl3
function name:  (null)
number of ops:  24
compiled vars:  !0 = $dom, !1 = $xp, !2 = $coll, !3 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    4     3        INIT_METHOD_CALL                                         !0, 'loadHTML'
    5     4        SEND_VAL_EX                                              '%3Chtml%3E%3Cbody%3E%0A%3Cdiv+class%3D%22app_content%22%3E+%0A%3Cul+class%3D%22js-events-container%22%3E...%0A%3Cli+class%3D%22single-event+live%22%3E...%3C%2Fli%3E+%0A%3Cli+class%3D%22single-event+live%22%3E...%3C%2Fli%3E+%0A%3Cli+class%3D%22single-event+live%22%3E...%3C%2Fli%3E+%0A%3Cli+class%3D%22single-event+live%22%3E...%3C%2Fli%3E+%0A%3Cli+class%3D%22single-event+live%22%3E+%0A%3A%3Abefore+%0A%2F%2FFirst+DIV+of+li+%0A%3Cdiv+class%3D%22single-event__code%22%3E+%0AEvent+Code%3A+%3Cstrong%3E96441%3C%2Fstrong%3E+%0A%3C%2Fdiv%3E+%0A%3Cdiv+class%3D%22single-event__time%22%3E+%0A%3Cspan+class%3D%22score+js-score%22%3ELIVE%3C%2Fspan%3E+%0A%3Cspan+class%3D%22time+js-timer%22%3E%3C%2Fspan%3E+%0A%3C%2Fdiv%3E+%0A%3Cdiv+class%3D%22single-event__players%22%3E+%0A%3Ca+href%3D%22%2Fsportsbook%2FSOCCER%2FBRAZIL_SERIE_D%2F400953%2F%22%3E+%0AAA+Portuguesa+RJ+%3Cspan%3E+v+%3C%2Fspan%3E+Audax+SP+%3C%2Fa%3E+%0A%3C%2Fdiv%3E%0A%3Cdiv+class%3D%22single-event__bets+three+markets%22%3E+%0A%3Cdiv+class%3D%22single-event__bets__container+js-bets-container%22%3E+%0A%3C%2Fbody%3E%3C%2Fhtml%3E'
    4     5        DO_FCALL                                      0          
   32     6        NEW                                              $8      'DOMXPath'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $8
   33    10        INIT_METHOD_CALL                                         !1, 'query'
         11        SEND_VAL_EX                                              '%2F%2Fdiv%5B%40class%3D%22single-event__code%22%5D'
         12        DO_FCALL                                      0  $11     
         13        ASSIGN                                                   !2, $11
   35    14        FETCH_OBJ_R                                      ~13     !2, 'length'
         15      > JMPZ                                                     ~13, ->23
   36    16    > > FE_RESET_R                                       $14     !2, ->22
         17    > > FE_FETCH_R                                               $14, !3, ->22
   37    18    >   FETCH_OBJ_R                                      ~15     !3, 'nodeValue'
         19        ECHO                                                     ~15
         20        ECHO                                                     '%0A'
   36    21      > JMP                                                      ->17
         22    >   FE_FREE                                                  $14
   39    23    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.98 ms | 998 KiB | 13 Q