3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = <<<EOD <td class="useragent"><a href="/useragents/parse/627832-chrome-windows-blink">Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36</a></td> EOD; $domDocument = new DOMDocument; $domDocument->loadHTML($text, LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($domDocument); $nodes = $xpath->query('//td[@class="useragent"]/a'); $res = []; foreach($nodes as $txt) { array_push($res, $txt->textContent); } print_r($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 25
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/IgutI
function name:  (null)
number of ops:  30
compiled vars:  !0 = $text, !1 = $domDocument, !2 = $xpath, !3 = $nodes, !4 = $res, !5 = $txt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Ctd+class%3D%22useragent%22%3E%3Ca+href%3D%22%2Fuseragents%2Fparse%2F627832-chrome-windows-blink%22%3EMozilla%2F5.0+%28Windows+NT+10.0%3B+Win64%3B+x64%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F60.0.3112.113+Safari%2F537.36%3C%2Fa%3E%3C%2Ftd%3E'
    6     1        NEW                                              $7      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $7
    7     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        SEND_VAL_EX                                              8196
          7        DO_FCALL                                      0          
    8     8        NEW                                              $11     'DOMXPath'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $11
    9    12        INIT_METHOD_CALL                                         !2, 'query'
         13        SEND_VAL_EX                                              '%2F%2Ftd%5B%40class%3D%22useragent%22%5D%2Fa'
         14        DO_FCALL                                      0  $14     
         15        ASSIGN                                                   !3, $14
   10    16        ASSIGN                                                   !4, <array>
   11    17      > FE_RESET_R                                       $17     !3, ->25
         18    > > FE_FETCH_R                                               $17, !5, ->25
   12    19    >   INIT_FCALL                                               'array_push'
         20        SEND_REF                                                 !4
         21        FETCH_OBJ_R                                      ~18     !5, 'textContent'
         22        SEND_VAL                                                 ~18
         23        DO_ICALL                                                 
   11    24      > JMP                                                      ->18
         25    >   FE_FREE                                                  $17
   14    26        INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !4
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.6 ms | 1401 KiB | 17 Q