3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ 'smiles.gif', 'kittens.jpg', 'biscuits.png', 'butthead.jpg', ]; $bad_words = ['beavis', 'butthead', 'winehouse']; $bad_extensions = ['.gif', '.tiff']; $branches = implode( '|', array_merge( $bad_words, array_map( fn($v) => preg_quote($v, '/') . '$', $bad_extensions ) ) ); var_export(preg_grep("/$branches/i", $array, PREG_GREP_INVERT));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cojN7
function name:  (null)
number of ops:  26
compiled vars:  !0 = $array, !1 = $bad_words, !2 = $bad_extensions, !3 = $branches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1        ASSIGN                                                       !1, <array>
   11     2        ASSIGN                                                       !2, <array>
   15     3        INIT_FCALL                                                   'array_merge'
   16     4        SEND_VAR                                                     !1
   17     5        INIT_FCALL                                                   'array_map'
   18     6        DECLARE_LAMBDA_FUNCTION                              ~7      [0]
          7        SEND_VAL                                                     ~7
   19     8        SEND_VAR                                                     !2
   17     9        DO_ICALL                                             $8      
   19    10        SEND_VAR                                                     $8
   15    11        DO_ICALL                                             $9      
   13    12        FRAMELESS_ICALL_2                implode             ~10     '%7C', $9
         13        ASSIGN                                                       !3, ~10
   23    14        INIT_FCALL                                                   'var_export'
         15        INIT_FCALL                                                   'preg_grep'
         16        ROPE_INIT                                         3  ~13     '%2F'
         17        ROPE_ADD                                          1  ~13     ~13, !3
         18        ROPE_END                                          2  ~12     ~13, '%2Fi'
         19        SEND_VAL                                                     ~12
         20        SEND_VAR                                                     !0
         21        SEND_VAL                                                     1
         22        DO_ICALL                                             $15     
         23        SEND_VAR                                                     $15
         24        DO_ICALL                                                     
         25      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cojN7
function name:  {closure:/in/cojN7:18}
number of ops:  8
compiled vars:  !0 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
          1        INIT_FCALL                                                   'preg_quote'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     '%2F'
          4        DO_ICALL                                             $1      
          5        CONCAT                                               ~2      $1, '%24'
          6      > RETURN                                                       ~2
          7*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
177.76 ms | 1924 KiB | 18 Q