3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allowedAttachmentTypes = '.jpeg,.gif,.png,.jpg,.bmp'; print_r( $allowedAttachmentTypes ); array_walk( (explode( ',', $allowedAttachmentTypes )), function( $var, $index ) use ( &$allowedAttachmentTypes ) { $allowedAttachmentTypes[ $index ] = preg_replace( '#[\s\.]+#', '', $var ); } ); print_r( $allowedAttachmentTypes );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Vq0mZ
function name:  (null)
number of ops:  18
compiled vars:  !0 = $allowedAttachmentTypes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '.jpeg%2C.gif%2C.png%2C.jpg%2C.bmp'
    4     1        INIT_FCALL                                               'print_r'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    6     4        INIT_FCALL                                               'array_walk'
          5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '%2C'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $3      
          9        SEND_VAR_NO_REF                               0          $3
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FVq0mZ%3A6%240'
         11        BIND_LEXICAL                                             ~4, !0
    9    12        SEND_VAL                                                 ~4
         13        DO_ICALL                                                 
   11    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FVq0mZ%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Vq0mZ
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $var, !1 = $index, !2 = $allowedAttachmentTypes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    8     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAL                                                 '%23%5B%5Cs%5C.%5D%2B%23'
          5        SEND_VAL                                                 ''
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8        ASSIGN_DIM                                               !2, !1
          9        OP_DATA                                                  $4
    9    10      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FVq0mZ%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.39 ms | 1396 KiB | 21 Q