3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class MakeMeCMS_Addon_Abstract { static protected $_ver = 0.1; static protected $_list = []; static protected function add($addon) { self::$_list += [$addon=>$addon]; } static protected function check($addon) { if(isset($_list[$addon]) && class_exists($_list[$addon].'_Master') && method_exists($_list[$addon].'_Master', Main())): return true; else: return false; endif; } } class MakeMeCMS_Addon_Call { private $_state = false; public function set($arg) { $this->_state = $arg; } public function state() { return $this->_state; } } class myAddon_Master extends MakeMeCMS_Addon_Abstract { static public $callable_from_templates = true; static public function Main(MakeMeCMS_Addon_Call $call) { parent::add('myAddon'); $call->set(true); return $call; } static public function hello() { echo('Hello World!'); } } $sysCall = new MakeMeCMS_Addon_Call; myAddon_Master::Main($sysCall); myAddon::hello();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SeN6l
function name:  (null)
number of ops:  9
compiled vars:  !0 = $sysCall
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   NEW                                              $1      'MakeMeCMS_Addon_Call'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   38     3        INIT_STATIC_METHOD_CALL                                  'myAddon_Master', 'Main'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0          
   39     6        INIT_STATIC_METHOD_CALL                                  'myAddon', 'hello'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class MakeMeCMS_Addon_Abstract:
Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SeN6l
function name:  add
number of ops:  5
compiled vars:  !0 = $addon
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_ARRAY                                       ~2      !0, !0
          2        ASSIGN_STATIC_PROP_OP                         1          '_list'
          3        OP_DATA                                                  ~2
    7     4      > RETURN                                                   null

End of function add

Function check:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
Branch analysis from position: 9
filename:       /in/SeN6l
function name:  check
number of ops:  24
compiled vars:  !0 = $addon, !1 = $_list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      !1, !0
          2      > JMPZ_EX                                          ~2      ~2, ->9
          3    >   INIT_FCALL                                               'class_exists'
          4        FETCH_DIM_R                                      ~3      !1, !0
          5        CONCAT                                           ~4      ~3, '_Master'
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
          8        BOOL                                             ~2      $5
          9    > > JMPZ_EX                                          ~2      ~2, ->19
         10    >   INIT_FCALL                                               'method_exists'
         11        FETCH_DIM_R                                      ~6      !1, !0
         12        CONCAT                                           ~7      ~6, '_Master'
         13        SEND_VAL                                                 ~7
         14        INIT_FCALL_BY_NAME                                       'Main'
         15        DO_FCALL                                      0  $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                         $9      
         18        BOOL                                             ~2      $9
         19    > > JMPZ                                                     ~2, ->22
   10    20    > > RETURN                                                   <true>
         21*       JMP                                                      ->23
   12    22    > > RETURN                                                   <false>
   14    23*     > RETURN                                                   null

End of function check

End of class MakeMeCMS_Addon_Abstract.

Class MakeMeCMS_Addon_Call:
Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SeN6l
function name:  set
number of ops:  4
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        ASSIGN_OBJ                                               '_state'
          2        OP_DATA                                                  !0
   20     3      > RETURN                                                   null

End of function set

Function state:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SeN6l
function name:  state
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   FETCH_OBJ_R                                      ~0      '_state'
          1      > RETURN                                                   ~0
   23     2*     > RETURN                                                   null

End of function state

End of class MakeMeCMS_Addon_Call.

Class myAddon_Master:
Function main:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SeN6l
function name:  Main
number of ops:  9
compiled vars:  !0 = $call
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   28     1        INIT_STATIC_METHOD_CALL                                  'add'
          2        SEND_VAL_EX                                              'myAddon'
          3        DO_FCALL                                      0          
   29     4        INIT_METHOD_CALL                                         !0, 'set'
          5        SEND_VAL_EX                                              <true>
          6        DO_FCALL                                      0          
   30     7      > RETURN                                                   !0
   31     8*     > RETURN                                                   null

End of function main

Function hello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SeN6l
function name:  hello
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   ECHO                                                     'Hello+World%21'
   34     1      > RETURN                                                   null

End of function hello

Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SeN6l
function name:  add
number of ops:  5
compiled vars:  !0 = $addon
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_ARRAY                                       ~2      !0, !0
          2        ASSIGN_STATIC_PROP_OP                         1          '_list'
          3        OP_DATA                                                  ~2
    7     4      > RETURN                                                   null

End of function add

Function check:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
Branch analysis from position: 9
filename:       /in/SeN6l
function name:  check
number of ops:  24
compiled vars:  !0 = $addon, !1 = $_list
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      !1, !0
          2      > JMPZ_EX                                          ~2      ~2, ->9
          3    >   INIT_FCALL                                               'class_exists'
          4        FETCH_DIM_R                                      ~3      !1, !0
          5        CONCAT                                           ~4      ~3, '_Master'
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
          8        BOOL                                             ~2      $5
          9    > > JMPZ_EX                                          ~2      ~2, ->19
         10    >   INIT_FCALL                                               'method_exists'
         11        FETCH_DIM_R                                      ~6      !1, !0
         12        CONCAT                                           ~7      ~6, '_Master'
         13        SEND_VAL                                                 ~7
         14        INIT_FCALL_BY_NAME                                       'Main'
         15        DO_FCALL                                      0  $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                         $9      
         18        BOOL                                             ~2      $9
         19    > > JMPZ                                                     ~2, ->22
   10    20    > > RETURN                                                   <true>
         21*       JMP                                                      ->23
   12    22    > > RETURN                                                   <false>
   14    23*     > RETURN                                                   null

End of function check

End of class myAddon_Master.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.36 ms | 1404 KiB | 17 Q