3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * This file is part of the symfony framework. * * (c) Fabien Potencier <fabien.potencier@symfony-project.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ /** * RokCommon_Service_Container_AbstractLoader is the abstract class used by all built-in loaders that are file based. * * @package symfony * @subpackage dependency_injection * @author Fabien Potencier <fabien.potencier@symfony-project.com> * @version SVN: $Id: File.php 10831 2013-05-29 19:32:17Z btowles $ */ abstract class RokCommon_Service_Container_Loader_File extends RokCommon_Service_Container_AbstractLoader { protected $paths = array(); /** * Constructor. * * @param RokCommon_Service_Container_Builder $container A RokCommon_Service_Container_Builder instance * @param string|array $paths A path or an array of paths where to look for resources */ public function __construct(RokCommon_Service_Container_Builder $container = null, $paths = array()) { parent::__construct($container); if (!is_array($paths)) { $paths = array($paths); } $this->paths = $paths; } /** * Loads a resource. * * A resource is a file or an array of files. * * The concrete classes always have access to an array of files * as this method converts single file argument to an array. * * @param mixed $resource The resource path */ public function load($resource) { if (!is_array($resource)) { $resource = array($resource); } return parent::load($resource); } protected function getAbsolutePath($file, $currentPath = null) { if (self::isAbsolutePath($file)) { return $file; } else if (null !== $currentPath && file_exists($currentPath.DIRECTORY_SEPARATOR.$file)) { return $currentPath.DIRECTORY_SEPARATOR.$file; } else { foreach ($this->paths as $path) { if (file_exists($path.DIRECTORY_SEPARATOR.$file)) { return $path.DIRECTORY_SEPARATOR.$file; } } } return $file; } static protected function isAbsolutePath($file) { if ($file[0] == '/' || $file[0] == '\\' || (strlen($file) > 3 && ctype_alpha($file[0]) && $file[1] == ':' && ($file[2] == '\\' || $file[2] == '/') ) ) { return true; } return false; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rTtXT
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   DECLARE_CLASS                                            'rokcommon_service_container_loader_file', 'rokcommon_service_container_abstractloader'
  101     1      > RETURN                                                   1

Class RokCommon_Service_Container_Loader_File:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/rTtXT
function name:  __construct
number of ops:  13
compiled vars:  !0 = $container, !1 = $paths
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      <array>
   33     2        INIT_STATIC_METHOD_CALL                                  
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   35     5        TYPE_CHECK                                  128  ~3      !1
          6        BOOL_NOT                                         ~4      ~3
          7      > JMPZ                                                     ~4, ->10
   37     8    >   INIT_ARRAY                                       ~5      !1
          9        ASSIGN                                                   !1, ~5
   40    10    >   ASSIGN_OBJ                                               'paths'
         11        OP_DATA                                                  !1
   41    12      > RETURN                                                   null

End of function __construct

Function load:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/rTtXT
function name:  load
number of ops:  11
compiled vars:  !0 = $resource
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   53     0  E >   RECV                                             !0      
   55     1        TYPE_CHECK                                  128  ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->6
   57     4    >   INIT_ARRAY                                       ~3      !0
          5        ASSIGN                                                   !0, ~3
   60     6    >   INIT_STATIC_METHOD_CALL                                  'load'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $5      
          9      > RETURN                                                   $5
   61    10*     > RETURN                                                   null

End of function load

Function getabsolutepath:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 35
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 35
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 34
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 16
filename:       /in/rTtXT
function name:  getAbsolutePath
number of ops:  38
compiled vars:  !0 = $file, !1 = $currentPath, !2 = $path
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   63     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
   65     2        INIT_STATIC_METHOD_CALL                                  'isAbsolutePath'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $3      
          5      > JMPZ                                                     $3, ->8
   67     6    > > RETURN                                                   !0
          7*       JMP                                                      ->36
   69     8    >   TYPE_CHECK                                  1020  ~4      !1
          9      > JMPZ_EX                                          ~4      ~4, ->16
         10    >   INIT_FCALL                                               'file_exists'
         11        CONCAT                                           ~5      !1, '%2F'
         12        CONCAT                                           ~6      ~5, !0
         13        SEND_VAL                                                 ~6
         14        DO_ICALL                                         $7      
         15        BOOL                                             ~4      $7
         16    > > JMPZ                                                     ~4, ->21
   71    17    >   CONCAT                                           ~8      !1, '%2F'
         18        CONCAT                                           ~9      ~8, !0
         19      > RETURN                                                   ~9
         20*       JMP                                                      ->36
   75    21    >   FETCH_OBJ_R                                      ~10     'paths'
         22      > FE_RESET_R                                       $11     ~10, ->35
         23    > > FE_FETCH_R                                               $11, !2, ->35
   77    24    >   INIT_FCALL                                               'file_exists'
         25        CONCAT                                           ~12     !2, '%2F'
         26        CONCAT                                           ~13     ~12, !0
         27        SEND_VAL                                                 ~13
         28        DO_ICALL                                         $14     
         29      > JMPZ                                                     $14, ->34
   79    30    >   CONCAT                                           ~15     !2, '%2F'
         31        CONCAT                                           ~16     ~15, !0
         32        FE_FREE                                                  $11
         33      > RETURN                                                   ~16
   75    34    > > JMP                                                      ->23
         35    >   FE_FREE                                                  $11
   84    36      > RETURN                                                   !0
   85    37*     > RETURN                                                   null

End of function getabsolutepath

Function isabsolutepath:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 47) Position 1 = 8, Position 2 = 29
Branch analysis from position: 8
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
2 jumps found. (Code = 46) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
2 jumps found. (Code = 47) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 31
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 28
Branch analysis from position: 20
Branch analysis from position: 16
Branch analysis from position: 29
Branch analysis from position: 7
filename:       /in/rTtXT
function name:  isAbsolutePath
number of ops:  33
compiled vars:  !0 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   87     0  E >   RECV                                             !0      
   89     1        FETCH_DIM_R                                      ~1      !0, 0
          2        IS_EQUAL                                         ~2      ~1, '%2F'
          3      > JMPNZ_EX                                         ~2      ~2, ->7
          4    >   FETCH_DIM_R                                      ~3      !0, 0
          5        IS_EQUAL                                         ~4      ~3, '%5C'
          6        BOOL                                             ~2      ~4
          7    > > JMPNZ_EX                                         ~2      ~2, ->29
   90     8    >   STRLEN                                           ~5      !0
          9        IS_SMALLER                                       ~6      3, ~5
         10      > JMPZ_EX                                          ~6      ~6, ->16
         11    >   INIT_FCALL                                               'ctype_alpha'
         12        FETCH_DIM_R                                      ~7      !0, 0
         13        SEND_VAL                                                 ~7
         14        DO_ICALL                                         $8      
         15        BOOL                                             ~6      $8
         16    > > JMPZ_EX                                          ~6      ~6, ->20
   91    17    >   FETCH_DIM_R                                      ~9      !0, 1
         18        IS_EQUAL                                         ~10     ~9, '%3A'
         19        BOOL                                             ~6      ~10
         20    > > JMPZ_EX                                          ~6      ~6, ->28
   92    21    >   FETCH_DIM_R                                      ~11     !0, 2
         22        IS_EQUAL                                         ~12     ~11, '%5C'
         23      > JMPNZ_EX                                         ~12     ~12, ->27
         24    >   FETCH_DIM_R                                      ~13     !0, 2
         25        IS_EQUAL                                         ~14     ~13, '%2F'
         26        BOOL                                             ~12     ~14
         27    >   BOOL                                             ~6      ~12
         28    >   BOOL                                             ~2      ~6
         29    > > JMPZ                                                     ~2, ->31
   96    30    > > RETURN                                                   <true>
   99    31    > > RETURN                                                   <false>
  100    32*     > RETURN                                                   null

End of function isabsolutepath

End of class RokCommon_Service_Container_Loader_File.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.7 ms | 1408 KiB | 17 Q