3v4l.org

run code in 300+ 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:  29
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>
   13     3        INIT_FCALL                                               'implode'
   14     4        SEND_VAL                                                 '%7C'
   15     5        INIT_FCALL                                               'array_merge'
   16     6        SEND_VAR                                                 !1
   17     7        INIT_FCALL                                               'array_map'
   18     8        DECLARE_LAMBDA_FUNCTION                          ~7      [0]
          9        SEND_VAL                                                 ~7
   19    10        SEND_VAR                                                 !2
   17    11        DO_ICALL                                         $8      
   19    12        SEND_VAR                                                 $8
   15    13        DO_ICALL                                         $9      
   19    14        SEND_VAR                                                 $9
   13    15        DO_ICALL                                         $10     
         16        ASSIGN                                                   !3, $10
   23    17        INIT_FCALL                                               'var_export'
         18        INIT_FCALL                                               'preg_grep'
         19        ROPE_INIT                                     3  ~13     '%2F'
         20        ROPE_ADD                                      1  ~13     ~13, !3
         21        ROPE_END                                      2  ~12     ~13, '%2Fi'
         22        SEND_VAL                                                 ~12
         23        SEND_VAR                                                 !0
         24        SEND_VAL                                                 1
         25        DO_ICALL                                         $15     
         26        SEND_VAR                                                 $15
         27        DO_ICALL                                                 
         28      > 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}
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.0.0


preferences:
144.39 ms | 1017 KiB | 19 Q