3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allowedAttachmentTypes = '.jpeg,.gif,.png,.jpg,.bmp'; print_r( $allowedAttachmentTypes ); $allowedAttachmentTypes = explode( ',', $allowedAttachmentTypes ); array_walk( $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/4L0j2
function name:  (null)
number of ops:  19
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                                                 
    5     4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '%2C'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        ASSIGN                                                   !0, $3
    7     9        INIT_FCALL                                               'array_walk'
         10        SEND_REF                                                 !0
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4L0j2%3A7%240'
         12        BIND_LEXICAL                                             ~5, !0
   10    13        SEND_VAL                                                 ~5
         14        DO_ICALL                                                 
   12    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F4L0j2%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4L0j2
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $var, !1 = $index, !2 = $allowedAttachmentTypes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    9     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
   10    10      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F4L0j2%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.28 ms | 1396 KiB | 21 Q