3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML </li> <li > <div class="widget-post-holder"> <a href="/45214" title="care with your skin against pollution" class="post-thumb" > <span class="post-cont"> health </span> <div class="librLoaderLine"></div> <img title="care with your skin against pollution" id="0045214" class="te lazy js-postPreview" data-src="https://wemedic.com/media/posts/201105/23/45214/original/14.jpg" src="https://wemedic.com/media/posts/201105/23/45214/original/14.jpg" data-libr="https://healthandc.com/media/posts/201105/23/45214/libr_225k_45214.webm" alt="care with your skin against pollution" /> <span class="hd-post" onclick="window.location.href ='/45214'"></span> </a> </li> <li > <div class="widget-post-holder"> <a href="/7487423" title="natural hair straightening" class="post-thumb" > <span class="post-cont"> health </span> <div class="librLoaderLine"></div> <img title="natural hair straightening" id="0045214" class="te lazy js-postPreview" data-src="https://wemedic.com/media/posts/201105/23/7487423/original/14.jpg" src="https://wemedic.com/media/posts/201105/23/45214/original/14.jpg" data-libr="https://healthandc.com/media/posts/201105/23/7487423/libr_225k_7487423.webm" alt="care with your skin against pollution" /> <span class="hd-post" onclick="window.location.href ='/7487423'"></span> </a> HTML; $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($dom); $results = []; foreach ($xpath->query('//*/@href') as $val) { if (preg_match('~^/\d{4,}$~', $val->value)) { array_push($results, $val->value); } } print_r($results);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 33
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 33
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 32
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/rrGsp
function name:  (null)
number of ops:  38
compiled vars:  !0 = $html, !1 = $dom, !2 = $xpath, !3 = $results, !4 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3C%2Fli%3E%0A++++%3Cli+%3E%0A++++++++%3Cdiv+class%3D%22widget-post-holder%22%3E%0A%0A++++%3Ca+href%3D%22%2F45214%22+title%3D%22care+with+your+skin+against+%0Apollution%22+class%3D%22post-thumb%22+%3E%0A%0A++++++++++++++++%3Cspan+class%3D%22post-cont%22%3E%0A++++++++++++++++++++++++++++++++++++health++++++++++++%3C%2Fspan%3E%0A++++++++++++++++++++++++++++++++%3Cdiv+class%3D%22librLoaderLine%22%3E%3C%2Fdiv%3E%0A++++++++++++++++++++++++++++%3Cimg+title%3D%22care+with+your+skin+against+pollution%22%0A+++++++++++++++++++++id%3D%220045214%22%0A+++++++++++++++++++++class%3D%22te+lazy+++js-postPreview%22%0A+++++++++++++++++++++data-src%3D%22https%3A%2F%2Fwemedic.com%2Fmedia%2Fposts%2F201105%2F23%2F45214%2Foriginal%2F14.jpg%22%0A++++++++++++src%3D%22https%3A%2F%2Fwemedic.com%2Fmedia%2Fposts%2F201105%2F23%2F45214%2Foriginal%2F14.jpg%22%0A+++++++++++++++++++++++++++++++++++++++++data-libr%3D%22https%3A%2F%2Fhealthandc.com%2Fmedia%2Fposts%2F201105%2F23%2F45214%2Flibr_225k_45214.webm%22%0A++++++++++++++++++++++++++++++++++++++alt%3D%22care+with+your+skin+against+pollution%22+%2F%3E%0A++++++++++++++++++++++++++++++++%3Cspan+class%3D%22hd-post%22+onclick%3D%22window.location.href+%3D%27%2F45214%27%22%3E%3C%2Fspan%3E%0A%0A++++++++++++++++++++++++++++++++++++++++++++++++%3C%2Fa%3E%0A++++++++++++++++++++++++++++++++++++++++++++++++%3C%2Fli%3E%0A++++%3Cli+%3E%0A++++++++%3Cdiv+class%3D%22widget-post-holder%22%3E%0A++++++++++++%3Ca+href%3D%22%2F7487423%22+title%3D%22natural+hair+straightening%22+class%3D%22post-thumb%22+%3E%0A++++++++++++++++%3Cspan+class%3D%22post-cont%22%3E%0A++++++++++++++++++++++++++++++++++++health++++++++++++%3C%2Fspan%3E%0A++++++++++++++++++++++++++++++++%3Cdiv+class%3D%22librLoaderLine%22%3E%3C%2Fdiv%3E%0A++++++++++++++++++++++++++++%3Cimg+title%3D%22natural+hair+straightening%22%0A+++++++++++++++++++++id%3D%220045214%22%0A+++++++++++++++++++++class%3D%22te+lazy+++js-postPreview%22%0A+++++++++++++++++++++data-src%3D%22https%3A%2F%2Fwemedic.com%2Fmedia%2Fposts%2F201105%2F23%2F7487423%2Foriginal%2F14.jpg%22%0A+++++++++++++++++++src%3D%22https%3A%2F%2Fwemedic.com%2Fmedia%2Fposts%2F201105%2F23%2F45214%2Foriginal%2F14.jpg%22%0A+++++++++++++++++++++++++++++++++++++++++data-libr%3D%22https%3A%2F%2Fhealthandc.com%2Fmedia%2Fposts%2F201105%2F23%2F7487423%2Flibr_225k_7487423.webm%22%0A++++++++++++++++++++++++++++++++++++++alt%3D%22care+with+your+skin+against+pollution%22+%2F%3E%0A++++++++++++++++++++++++++++++++%3Cspan+class%3D%22hd-post%22+onclick%3D%22window.location.href+%3D%27%2F7487423%27%22%3E%3C%2Fspan%3E%0A%0A++++++++++++++++++++++++++++++++++++++++++++++++%3C%2Fa%3E'
   42     1        NEW                                              $6      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
   43     4        INIT_FCALL                                               'libxml_use_internal_errors'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                                 
   44     7        INIT_METHOD_CALL                                         !1, 'loadHTML'
          8        SEND_VAR_EX                                              !0
          9        SEND_VAL_EX                                              8196
         10        DO_FCALL                                      0          
   45    11        NEW                                              $11     'DOMXPath'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !2, $11
   46    15        ASSIGN                                                   !3, <array>
   47    16        INIT_METHOD_CALL                                         !2, 'query'
         17        SEND_VAL_EX                                              '%2F%2F%2A%2F%40href'
         18        DO_FCALL                                      0  $15     
         19      > FE_RESET_R                                       $16     $15, ->33
         20    > > FE_FETCH_R                                               $16, !4, ->33
   48    21    >   INIT_FCALL                                               'preg_match'
         22        SEND_VAL                                                 '%7E%5E%2F%5Cd%7B4%2C%7D%24%7E'
         23        FETCH_OBJ_R                                      ~17     !4, 'value'
         24        SEND_VAL                                                 ~17
         25        DO_ICALL                                         $18     
         26      > JMPZ                                                     $18, ->32
   49    27    >   INIT_FCALL                                               'array_push'
         28        SEND_REF                                                 !3
         29        FETCH_OBJ_R                                      ~19     !4, 'value'
         30        SEND_VAL                                                 ~19
         31        DO_ICALL                                                 
   47    32    > > JMP                                                      ->20
         33    >   FE_FREE                                                  $16
   52    34        INIT_FCALL                                               'print_r'
         35        SEND_VAR                                                 !3
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.42 ms | 1018 KiB | 17 Q