3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array('assets/image/man.jpg', 'assets/image/violin.jpg', 'assets/image/test.txt'); $images = array(); $images_exts = array('jpg','png'); foreach($input as $value) { echo @end(explode('.', $value)); if(in_array(@end(explode('.', $value)), $images_exts)) { $images[] = $value; } } var_dump($images);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 32
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 32
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 31
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/b0njd
function name:  (null)
number of ops:  37
compiled vars:  !0 = $input, !1 = $images, !2 = $images_exts, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, <array>
    5     3      > FE_RESET_R                                       $7      !0, ->32
          4    > > FE_FETCH_R                                               $7, !3, ->32
    7     5    >   BEGIN_SILENCE                                    ~8      
          6        INIT_FCALL                                               'end'
          7        INIT_FCALL                                               'explode'
          8        SEND_VAL                                                 '.'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $9      
         11        SEND_VAR_NO_REF                               0          $9
         12        DO_ICALL                                         $10     
         13        END_SILENCE                                              ~8
         14        ECHO                                                     $10
    8    15        INIT_FCALL                                               'in_array'
         16        BEGIN_SILENCE                                    ~11     
         17        INIT_FCALL                                               'end'
         18        INIT_FCALL                                               'explode'
         19        SEND_VAL                                                 '.'
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                         $12     
         22        SEND_VAR_NO_REF                               0          $12
         23        DO_ICALL                                         $13     
         24        END_SILENCE                                              ~11
         25        SEND_VAR                                                 $13
         26        SEND_VAR                                                 !2
         27        DO_ICALL                                         $14     
         28      > JMPZ                                                     $14, ->31
   10    29    >   ASSIGN_DIM                                               !1
         30        OP_DATA                                                  !3
    5    31    > > JMP                                                      ->4
         32    >   FE_FREE                                                  $7
   13    33        INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !1
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.01 ms | 1009 KiB | 17 Q