3v4l.org

run code in 300+ PHP versions simultaneously
<?php $links = [ "https://www.booking.com/hotel/it/nh-collection-venezia-palazzo-barocci.en-gb.html", "https://www.booking.com/it/nh-collection-venezia-palazzo-barocci.en-gb.html" ]; $pattern = '~^https?://.*?/hotel~'; foreach ($links as $link) { if (!(substr($link, 0, 4 ) === "http" && strpos($link, '/hotel/') !== false)) { echo "No match $link" . PHP_EOL; continue; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 25
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 25
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/IOvfn
function name:  (null)
number of ops:  27
compiled vars:  !0 = $links, !1 = $pattern, !2 = $link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    7     1        ASSIGN                                                   !1, '%7E%5Ehttps%3F%3A%2F%2F.%2A%3F%2Fhotel%7E'
    9     2      > FE_RESET_R                                       $5      !0, ->25
          3    > > FE_FETCH_R                                               $5, !2, ->25
   10     4    >   INIT_FCALL                                               'substr'
          5        SEND_VAR                                                 !2
          6        SEND_VAL                                                 0
          7        SEND_VAL                                                 4
          8        DO_ICALL                                         $6      
          9        IS_IDENTICAL                                     ~7      $6, 'http'
         10      > JMPZ_EX                                          ~7      ~7, ->17
         11    >   INIT_FCALL                                               'strpos'
         12        SEND_VAR                                                 !2
         13        SEND_VAL                                                 '%2Fhotel%2F'
         14        DO_ICALL                                         $8      
         15        TYPE_CHECK                                  1018  ~9      $8
         16        BOOL                                             ~7      ~9
         17    >   BOOL_NOT                                         ~10     ~7
         18      > JMPZ                                                     ~10, ->24
   11    19    >   NOP                                                      
         20        FAST_CONCAT                                      ~11     'No+match+', !2
         21        CONCAT                                           ~12     ~11, '%0A'
         22        ECHO                                                     ~12
   12    23      > JMP                                                      ->3
    9    24    > > JMP                                                      ->3
         25    >   FE_FREE                                                  $5
   14    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.36 ms | 1000 KiB | 15 Q