3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = <<<TEXT I like foo << - not allowed I like fooSomeRandomString << - not allowed I like food << - allowed I like football << - allowed I like drawing << - allowed I dislike drawing << - not allowed TEXT; $pattern = '#I like (?<like>(?!foo(?!d|tball))[^ ]+)#'; preg_match_all($pattern, $text, $matches); foreach($matches['like'] as $like) { echo $like . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/R7TfC
function name:  (null)
number of ops:  15
compiled vars:  !0 = $text, !1 = $pattern, !2 = $matches, !3 = $like
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'I+like+foo+++++++++++++++++%3C%3C+-+not+allowed%0AI+like+fooSomeRandomString+%3C%3C+-+not+allowed%0AI+like+food++++++++++++++++%3C%3C+-+allowed%0AI+like+football++++++++++++%3C%3C+-+allowed%0AI+like+drawing+++++++++++++%3C%3C+-+allowed%0AI+dislike+drawing++++++++++%3C%3C+-+not+allowed'
   12     1        ASSIGN                                                   !1, '%23I+like+%28%3F%3Clike%3E%28%3F%21foo%28%3F%21d%7Ctball%29%29%5B%5E+%5D%2B%29%23'
   13     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
   15     7        FETCH_DIM_R                                      ~7      !2, 'like'
          8      > FE_RESET_R                                       $8      ~7, ->13
          9    > > FE_FETCH_R                                               $8, !3, ->13
   16    10    >   CONCAT                                           ~9      !3, '%0A'
         11        ECHO                                                     ~9
   15    12      > JMP                                                      ->9
         13    >   FE_FREE                                                  $8
   17    14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.75 ms | 1395 KiB | 15 Q