3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fileIsNotIncluded($files = null) { if (empty($files)) { return false; } // Caso $files seja uma String (ou qualquer outro valor do tipo Scalar), converta para um Array if (is_scalar($files)) { $files = array($files); } // Pega os nomes dos arquivos já incluídos com as funções "include", "include_once", "require" e "require_once" $includedFiles = get_included_files(); foreach ($files as $fileName) { if ( ! in_array($fileName, $includedFiles)) { return true; } } return false; } var_dump( fileIsNotIncluded('Teste.php') );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OuCI4
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'fileisnotincluded'
          2        SEND_VAL                                                 'Teste.php'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function fileisnotincluded:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 22
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 22
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 8
filename:       /in/OuCI4
function name:  fileIsNotIncluded
number of ops:  25
compiled vars:  !0 = $files, !1 = $includedFiles, !2 = $fileName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      null
    4     1        ISSET_ISEMPTY_CV                                         !0
          2      > JMPZ                                                     ~3, ->4
    5     3    > > RETURN                                                   <false>
    9     4    >   TYPE_CHECK                                  124          !0
          5      > JMPZ                                                     ~4, ->8
   10     6    >   INIT_ARRAY                                       ~5      !0
          7        ASSIGN                                                   !0, ~5
   14     8    >   INIT_FCALL                                               'get_included_files'
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !1, $7
   16    11      > FE_RESET_R                                       $9      !0, ->22
         12    > > FE_FETCH_R                                               $9, !2, ->22
   17    13    >   INIT_FCALL                                               'in_array'
         14        SEND_VAR                                                 !2
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $10     
         17        BOOL_NOT                                         ~11     $10
         18      > JMPZ                                                     ~11, ->21
   18    19    >   FE_FREE                                                  $9
         20      > RETURN                                                   <true>
   16    21    > > JMP                                                      ->12
         22    >   FE_FREE                                                  $9
   22    23      > RETURN                                                   <false>
   23    24*     > RETURN                                                   null

End of function fileisnotincluded

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.33 ms | 1403 KiB | 20 Q