3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Loader { ##針對路徑 public $_path = "include/public/"; ##文件夾名稱 public $_dir_name = 'MobileShop'; ##對像庫 static private $_Object = array(); ##構造方法 function __construct(){ // } ##核心接口調用方法 function Mode($name=''){ ##是否有重定文件夾 if(empty($name)){ die("Error: can not find!".$name); } ##該定位是否為一個文件夾 $path = FILE_PATH.$this->_path.$this->_dir_name; if(!is_dir($path)){ die("Error: ".$this->_dir_name." Is not a dir!"); } ##判斷是否有文件 $fileName = $path."/".$name.".class.php"; if(!file_exists($fileName)){ die("Error: $name The file is not exists!"); } ##判斷是否有加載控制方法 if(!class_exists($this->_dir_name."Control")){ include($path."/".$this->_dir_name."Control.php"); } if(!class_exists($this->_dir_name."Control")){ die("Error:CLASS:".$this->_dir_name."Control is not exists!"); } ##判斷對像是否存在 if(!class_exists($name)){ include($fileName); } if(!class_exists($name)){ die("Error:CLASS: ".$name." is not exists!"); } self::$_Object[$name] = new $name; return self::$_Object[$name]; } ##魔術方法取值 function __get($name){ ##判斷對像庫里是否有存在相同的對像,有則直接返回 if(isset(self::$_Object[$name]) && is_object(self::$_Object[$name])){ return self::$_Object[$name]; }else{ $object = self::Mode($name); return $object; } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FPUWq
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   57     0  E > > RETURN                                                   1

Class Loader:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FPUWq
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   null

End of function __construct

Function mode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 33
Branch analysis from position: 29
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 45
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 56
Branch analysis from position: 52
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 62
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 70
Branch analysis from position: 67
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 70
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
Branch analysis from position: 45
filename:       /in/FPUWq
function name:  Mode
number of ops:  80
compiled vars:  !0 = $name, !1 = $path, !2 = $fileName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV_INIT                                        !0      ''
   17     1        ISSET_ISEMPTY_CV                                         !0
          2      > JMPZ                                                     ~3, ->5
   18     3    >   CONCAT                                           ~4      'Error%3A+can+not+find%21', !0
          4      > EXIT                                                     ~4
   21     5    >   FETCH_CONSTANT                                   ~5      'FILE_PATH'
          6        FETCH_OBJ_R                                      ~6      '_path'
          7        CONCAT                                           ~7      ~5, ~6
          8        FETCH_OBJ_R                                      ~8      '_dir_name'
          9        CONCAT                                           ~9      ~7, ~8
         10        ASSIGN                                                   !1, ~9
   22    11        INIT_FCALL                                               'is_dir'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $11     
         14        BOOL_NOT                                         ~12     $11
         15      > JMPZ                                                     ~12, ->20
   23    16    >   FETCH_OBJ_R                                      ~13     '_dir_name'
         17        CONCAT                                           ~14     'Error%3A+', ~13
         18        CONCAT                                           ~15     ~14, '+Is+not+a+dir%21'
         19      > EXIT                                                     ~15
   26    20    >   CONCAT                                           ~16     !1, '%2F'
         21        CONCAT                                           ~17     ~16, !0
         22        CONCAT                                           ~18     ~17, '.class.php'
         23        ASSIGN                                                   !2, ~18
   27    24        INIT_FCALL                                               'file_exists'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $20     
         27        BOOL_NOT                                         ~21     $20
         28      > JMPZ                                                     ~21, ->33
   28    29    >   ROPE_INIT                                     3  ~23     'Error%3A+'
         30        ROPE_ADD                                      1  ~23     ~23, !0
         31        ROPE_END                                      2  ~22     ~23, '+The+file+is+not+exists%21'
         32      > EXIT                                                     ~22
   31    33    >   INIT_FCALL                                               'class_exists'
         34        FETCH_OBJ_R                                      ~25     '_dir_name'
         35        CONCAT                                           ~26     ~25, 'Control'
         36        SEND_VAL                                                 ~26
         37        DO_ICALL                                         $27     
         38        BOOL_NOT                                         ~28     $27
         39      > JMPZ                                                     ~28, ->45
   32    40    >   CONCAT                                           ~29     !1, '%2F'
         41        FETCH_OBJ_R                                      ~30     '_dir_name'
         42        CONCAT                                           ~31     ~29, ~30
         43        CONCAT                                           ~32     ~31, 'Control.php'
         44        INCLUDE_OR_EVAL                                          ~32, INCLUDE
   34    45    >   INIT_FCALL                                               'class_exists'
         46        FETCH_OBJ_R                                      ~34     '_dir_name'
         47        CONCAT                                           ~35     ~34, 'Control'
         48        SEND_VAL                                                 ~35
         49        DO_ICALL                                         $36     
         50        BOOL_NOT                                         ~37     $36
         51      > JMPZ                                                     ~37, ->56
   35    52    >   FETCH_OBJ_R                                      ~38     '_dir_name'
         53        CONCAT                                           ~39     'Error%3ACLASS%3A', ~38
         54        CONCAT                                           ~40     ~39, 'Control++is+not+exists%21'
         55      > EXIT                                                     ~40
   38    56    >   INIT_FCALL                                               'class_exists'
         57        SEND_VAR                                                 !0
         58        DO_ICALL                                         $41     
         59        BOOL_NOT                                         ~42     $41
         60      > JMPZ                                                     ~42, ->62
   39    61    >   INCLUDE_OR_EVAL                                          !2, INCLUDE
   41    62    >   INIT_FCALL                                               'class_exists'
         63        SEND_VAR                                                 !0
         64        DO_ICALL                                         $44     
         65        BOOL_NOT                                         ~45     $44
         66      > JMPZ                                                     ~45, ->70
   42    67    >   CONCAT                                           ~46     'Error%EF%BC%9ACLASS%3A+', !0
         68        CONCAT                                           ~47     ~46, '+is+not+exists%21'
         69      > EXIT                                                     ~47
   44    70    >   FETCH_CLASS                                   0  $50     !0
         71        NEW                                              $51     $50
         72        DO_FCALL                                      0          
         73        FETCH_STATIC_PROP_W          unknown             $48     '_Object'
         74        ASSIGN_DIM                                               $48, !0
         75        OP_DATA                                                  $51
   45    76        FETCH_STATIC_PROP_R          unknown             ~53     '_Object'
         77        FETCH_DIM_R                                      ~54     ~53, !0
         78      > RETURN                                                   ~54
   46    79*     > RETURN                                                   null

End of function mode

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/FPUWq
function name:  __get
number of ops:  19
compiled vars:  !0 = $name, !1 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   48     0  E >   RECV                                             !0      
   50     1        FETCH_STATIC_PROP_IS                             ~2      '_Object'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      ~2, !0
          3      > JMPZ_EX                                          ~3      ~3, ->8
          4    >   FETCH_STATIC_PROP_R          unknown             ~4      '_Object'
          5        FETCH_DIM_R                                      ~5      ~4, !0
          6        TYPE_CHECK                                  256  ~6      ~5
          7        BOOL                                             ~3      ~6
          8    > > JMPZ                                                     ~3, ->13
   51     9    >   FETCH_STATIC_PROP_R          unknown             ~7      '_Object'
         10        FETCH_DIM_R                                      ~8      ~7, !0
         11      > RETURN                                                   ~8
         12*       JMP                                                      ->18
   53    13    >   INIT_STATIC_METHOD_CALL                                  'Mode'
         14        SEND_VAR                                                 !0
         15        DO_FCALL                                      0  $9      
         16        ASSIGN                                                   !1, $9
   54    17      > RETURN                                                   !1
   56    18*     > RETURN                                                   null

End of function __get

End of class Loader.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.4 ms | 1404 KiB | 19 Q