3v4l.org

run code in 500+ PHP versions simultaneously
<?php $dossier = ['a.txt', 'b.csv']; $_GET['fichier'] = 'b.csv'; if(!empty($_GET['fichier']) && in_array($fichier=$_GET['fichier'], $dossier)) echo $fichier, ' OK'; else echo 'pas bon';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/PpCHH
function name:  (null)
number of ops:  19
compiled vars:  !0 = $dossier, !1 = $fichier
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        FETCH_W                          global              $3      '_GET'
          2        ASSIGN_DIM                                                   $3, 'fichier'
          3        OP_DATA                                                      'b.csv'
    5     4        FETCH_IS                                             ~5      '_GET'
          5        ISSET_ISEMPTY_DIM_OBJ                             1  ~6      ~5, 'fichier'
          6        BOOL_NOT                                             ~7      ~6
          7      > JMPZ_EX                                              ~7      ~7, ->13
          8    >   FETCH_R                          global              ~8      '_GET'
          9        FETCH_DIM_R                                          ~9      ~8, 'fichier'
         10        ASSIGN                                               ~10     !1, ~9
         11        FRAMELESS_ICALL_2                in_array            ~11     ~10, !0
         12        BOOL                                                 ~7      ~11
         13    > > JMPZ                                                         ~7, ->17
         14    >   ECHO                                                         !1
         15        ECHO                                                         '+OK'
         16      > JMP                                                          ->18
    6    17    >   ECHO                                                         'pas+bon'
         18    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
197.21 ms | 2206 KiB | 13 Q