3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allowedExts = array("jpg", "jpeg", "gif", "png"); $extension = end(explode(".", "bleh.blah")); if(in_array($extension, $allowedExts)){ // your code here }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/EQ1sc
function name:  (null)
number of ops:  15
compiled vars:  !0 = $allowedExts, !1 = $extension
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        INIT_FCALL                                               'end'
          2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '.'
          4        SEND_VAL                                                 'bleh.blah'
          5        DO_ICALL                                         $3      
          6        SEND_VAR_NO_REF                               0          $3
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !1, $4
    5     9        INIT_FCALL                                               'in_array'
         10        SEND_VAR                                                 !1
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $6      
         13      > JMPZ                                                     $6, ->14
    9    14    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.07 ms | 1394 KiB | 19 Q