3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ 'http://example.com/topic/Funny/G1pdeJm', 'http://example.com/topic/Funny/viral', 'http://example.com/topic/Funny/time', 'http://example.com/topic/Funny/top', 'http://example.com/topic/Funny/top/week', 'http://example.com/topic/Funny/top/month', 'http://example.com/topic/Funny/top/year', 'http://example.com/topic/Funny/top/all', 'http://example.com/topic/NotFunny/IL2dsRq', ]; $result = []; foreach ($tests as $str) { if (preg_match('~^http://[^/]+/topic/Funny/(?!viral|time|top(?:/week|/month|/year|/all)?)~', $str)) { $result[] = $str; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/inOIY
function name:  (null)
number of ops:  17
compiled vars:  !0 = $tests, !1 = $result, !2 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, <array>
   16     2      > FE_RESET_R                                       $5      !0, ->12
          3    > > FE_FETCH_R                                               $5, !2, ->12
   17     4    >   INIT_FCALL                                               'preg_match'
          5        SEND_VAL                                                 '%7E%5Ehttp%3A%2F%2F%5B%5E%2F%5D%2B%2Ftopic%2FFunny%2F%28%3F%21viral%7Ctime%7Ctop%28%3F%3A%2Fweek%7C%2Fmonth%7C%2Fyear%7C%2Fall%29%3F%29%7E'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $6      
          8      > JMPZ                                                     $6, ->11
   18     9    >   ASSIGN_DIM                                               !1
         10        OP_DATA                                                  !2
   16    11    > > JMP                                                      ->3
         12    >   FE_FREE                                                  $5
   21    13        INIT_FCALL                                               'var_export'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.3 ms | 1437 KiB | 15 Q