3v4l.org

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

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

End of function __construct

Function checkpath:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/om9d0
function name:  checkPath
number of ops:  16
compiled vars:  !0 = $name, !1 = $path
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1        FETCH_CONSTANT                                   ~2      'FILE_PATH'
          2        FETCH_OBJ_R                                      ~3      '_path'
          3        CONCAT                                           ~4      ~2, ~3
          4        CONCAT                                           ~5      ~4, !0
          5        ASSIGN                                                   !1, ~5
   17     6        INIT_FCALL                                               'is_dir'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $7      
          9        BOOL_NOT                                         ~8      $7
         10      > JMPZ                                                     ~8, ->14
   18    11    >   CONCAT                                           ~9      'Error%3A+', !0
         12        CONCAT                                           ~10     ~9, '+Is+not+a+dir%21'
         13      > EXIT                                                     ~10
   20    14    > > RETURN                                                   <true>
   21    15*     > RETURN                                                   null

End of function checkpath

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/om9d0
function name:  __get
number of ops:  26
compiled vars:  !0 = $name, !1 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   24     1        INIT_METHOD_CALL                                         'checkPath'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   26     4        FETCH_STATIC_PROP_IS                             ~3      '_Object'
          5        ISSET_ISEMPTY_DIM_OBJ                         0  ~4      ~3, !0
          6      > JMPZ_EX                                          ~4      ~4, ->11
          7    >   FETCH_STATIC_PROP_R          unknown             ~5      '_Object'
          8        FETCH_DIM_R                                      ~6      ~5, !0
          9        TYPE_CHECK                                  256  ~7      ~6
         10        BOOL                                             ~4      ~7
         11    > > JMPZ                                                     ~4, ->16
   27    12    >   FETCH_STATIC_PROP_R          unknown             ~8      '_Object'
         13        FETCH_DIM_R                                      ~9      ~8, !0
         14      > RETURN                                                   ~9
         15*       JMP                                                      ->25
   29    16    >   NEW                                              $10     'Loader'
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !1, $10
   30    19        ASSIGN_OBJ                                               !1, '_dir_name'
         20        OP_DATA                                                  !0
   31    21        FETCH_STATIC_PROP_W          unknown             $14     '_Object'
         22        ASSIGN_DIM                                               $14, !0
         23        OP_DATA                                                  !1
   32    24      > RETURN                                                   !1
   34    25*     > RETURN                                                   null

End of function __get

End of class Mode.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.24 ms | 1400 KiB | 15 Q