3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<a href="www.website.fr/123/">*****</a>'; $doc = new DOMDocument(); $doc->loadHTML($html); $xpath = new DOMXPath($doc); if (count($xpath->query("//a[contains(@href, 'website.fr/')]"))) echo "found"; else echo "not found";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TP4RH
function name:  (null)
number of ops:  20
compiled vars:  !0 = $html, !1 = $doc, !2 = $xpath
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Ca+href%3D%22www.website.fr%2F123%2F%22%3E%2A%2A%2A%2A%2A%3C%2Fa%3E'
    3     1        NEW                                              $4      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
    4     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    5     7        NEW                                              $8      'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $8
    6    11        INIT_METHOD_CALL                                         !2, 'query'
         12        SEND_VAL_EX                                              '%2F%2Fa%5Bcontains%28%40href%2C+%27website.fr%2F%27%29%5D'
         13        DO_FCALL                                      0  $11     
         14        COUNT                                            ~12     $11
         15      > JMPZ                                                     ~12, ->18
    7    16    >   ECHO                                                     'found'
    6    17      > JMP                                                      ->19
    9    18    >   ECHO                                                     'not+found'
         19    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.38 ms | 994 KiB | 13 Q