3v4l.org

run code in 500+ 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 = 29
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 29
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 28
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/b0njd
function name:  (null)
number of ops:  34
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, ->29
          4    > > FE_FETCH_R                                                   $7, !3, ->29
    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        BEGIN_SILENCE                                        ~11     
         16        INIT_FCALL                                                   'end'
         17        INIT_FCALL                                                   'explode'
         18        SEND_VAL                                                     '.'
         19        SEND_VAR                                                     !3
         20        DO_ICALL                                             $12     
         21        SEND_VAR_NO_REF                                   0          $12
         22        DO_ICALL                                             $13     
         23        END_SILENCE                                                  ~11
         24        FRAMELESS_ICALL_2                in_array            ~14     $13, !2
         25      > JMPZ                                                         ~14, ->28
   10    26    >   ASSIGN_DIM                                                   !1
         27        OP_DATA                                                      !3
    5    28    > > JMP                                                          ->4
         29    >   FE_FREE                                                      $7
   13    30        INIT_FCALL                                                   'var_dump'
         31        SEND_VAR                                                     !1
         32        DO_ICALL                                                     
         33      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.66 ms | 2039 KiB | 16 Q