3v4l.org

run code in 300+ PHP versions simultaneously
<?php include 'Campanha.class'; function checkIfFileIsIncluded($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( checkIfFileIsIncluded('Campanha.class') );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TIJsu
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INCLUDE_OR_EVAL                                          'Campanha.class', INCLUDE
   28     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'checkiffileisincluded'
          3        SEND_VAL                                                 'Campanha.class'
          4        DO_FCALL                                      0  $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function checkiffileisincluded:
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/TIJsu
function name:  checkIfFileIsIncluded
number of ops:  25
compiled vars:  !0 = $files, !1 = $includedFiles, !2 = $fileName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      null
    7     1        ISSET_ISEMPTY_CV                                         !0
          2      > JMPZ                                                     ~3, ->4
    8     3    > > RETURN                                                   <false>
   12     4    >   TYPE_CHECK                                  124          !0
          5      > JMPZ                                                     ~4, ->8
   13     6    >   INIT_ARRAY                                       ~5      !0
          7        ASSIGN                                                   !0, ~5
   17     8    >   INIT_FCALL                                               'get_included_files'
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !1, $7
   19    11      > FE_RESET_R                                       $9      !0, ->22
         12    > > FE_FETCH_R                                               $9, !2, ->22
   20    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
   21    19    >   FE_FREE                                                  $9
         20      > RETURN                                                   <true>
   19    21    > > JMP                                                      ->12
         22    >   FE_FREE                                                  $9
   25    23      > RETURN                                                   <false>
   26    24*     > RETURN                                                   null

End of function checkiffileisincluded

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.36 ms | 1403 KiB | 23 Q