3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = '/lejebolig/*.html'; echo ltrim($pattern,'/'); var_dump(fnmatch($pattern, 'lejebolig/1.html') || fnmatch(rtrim($pattern,'/'), 'lejebolig/1.html'));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 12, Position 2 = 21
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/oX7At
function name:  (null)
number of ops:  24
compiled vars:  !0 = $pattern
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%2Flejebolig%2F%2A.html'
    3     1        INIT_FCALL                                               'ltrim'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%2F'
          4        DO_ICALL                                         $2      
          5        ECHO                                                     $2
    4     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'fnmatch'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 'lejebolig%2F1.html'
         10        DO_ICALL                                         $3      
         11      > JMPNZ_EX                                         ~4      $3, ->21
         12    >   INIT_FCALL                                               'fnmatch'
         13        INIT_FCALL                                               'rtrim'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 '%2F'
         16        DO_ICALL                                         $5      
         17        SEND_VAR                                                 $5
         18        SEND_VAL                                                 'lejebolig%2F1.html'
         19        DO_ICALL                                         $6      
         20        BOOL                                             ~4      $6
         21    >   SEND_VAL                                                 ~4
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.86 ms | 1395 KiB | 21 Q