3v4l.org

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

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

End of function %00%7Bclosure%7D%2Fin%2FK3btW%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.06 ms | 1396 KiB | 21 Q