3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<HTML <a href="/clothing/jacket/">Jacket</a> <a href="/clothing/Socks/">Socks</a> <a href="/clothing/Shoes/">Shoes</a> <a href="/clothing/Skirt/" class="xxx">test Skirt test</a> HTML; $type = 'skirt'; preg_match('!href="([^"]+)"[^>]*?>[^<]*?'.$type.'[^<]*?<!usi', $data, $out); print_r($out);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/25S3Y
function name:  (null)
number of ops:  13
compiled vars:  !0 = $data, !1 = $type, !2 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Ca+href%3D%22%2Fclothing%2Fjacket%2F%22%3EJacket%3C%2Fa%3E%0A%3Ca+href%3D%22%2Fclothing%2FSocks%2F%22%3ESocks%3C%2Fa%3E%0A%3Ca+href%3D%22%2Fclothing%2FShoes%2F%22%3EShoes%3C%2Fa%3E%0A%3Ca+href%3D%22%2Fclothing%2FSkirt%2F%22+class%3D%22xxx%22%3Etest+Skirt+test%3C%2Fa%3E'
    9     1        ASSIGN                                                   !1, 'skirt'
   11     2        INIT_FCALL                                               'preg_match'
          3        CONCAT                                           ~5      '%21href%3D%22%28%5B%5E%22%5D%2B%29%22%5B%5E%3E%5D%2A%3F%3E%5B%5E%3C%5D%2A%3F', !1
          4        CONCAT                                           ~6      ~5, '%5B%5E%3C%5D%2A%3F%3C%21usi'
          5        SEND_VAL                                                 ~6
          6        SEND_VAR                                                 !0
          7        SEND_REF                                                 !2
          8        DO_ICALL                                                 
   13     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
189.66 ms | 1398 KiB | 17 Q