3v4l.org

run code in 300+ PHP versions simultaneously
<?php // index.php //require(baseController.php); //require(basemodel.php); //require(header.php); // baseController.php class baseController { function __construct() { } function echoView($view) { $this->view->render('views/header');// go to view controller and use the render method to echo view.php view. } } // basemodel.php class baseModel { function __construct() { // acces db with new db(); } public function userList() { $query = $this->db->prepare('SELECET....'); $query->execute(); return $query->fetchAll(); } } //view.php //<p>This is a view!</p> //header.php //<header></header> // controller methods operate models // userController.php class userController extends baseController { function __construct() { parent::baseController; } function edit($i) { $tis->view->user = $this->model->userList(); $this->view->render(user/edit); } } // model methods operate on the database // usermodel.php class userModel extends baseModel{ function __construct() { parent::__construct(); } public function userList() { $query = $this->db->prepare('SELECET users FROM...'); $query->execute(); return $query->fetchAll(); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8o96R
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   73     0  E > > RETURN                                                   1

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

End of function __construct

Function echoview:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8o96R
function name:  echoView
number of ops:  6
compiled vars:  !0 = $view
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        FETCH_OBJ_R                                      ~1      'view'
          2        INIT_METHOD_CALL                                         ~1, 'render'
          3        SEND_VAL_EX                                              'views%2Fheader'
          4        DO_FCALL                                      0          
   19     5      > RETURN                                                   null

End of function echoview

End of class baseController.

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

End of function __construct

Function userlist:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8o96R
function name:  userList
number of ops:  11
compiled vars:  !0 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   FETCH_OBJ_R                                      ~1      'db'
          1        INIT_METHOD_CALL                                         ~1, 'prepare'
          2        SEND_VAL_EX                                              'SELECET....'
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !0, $2
   30     5        INIT_METHOD_CALL                                         !0, 'execute'
          6        DO_FCALL                                      0          
   31     7        INIT_METHOD_CALL                                         !0, 'fetchAll'
          8        DO_FCALL                                      0  $5      
          9      > RETURN                                                   $5
   32    10*     > RETURN                                                   null

End of function userlist

End of class baseModel.

Class userController:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8o96R
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   52     0  E >   FETCH_CLASS_CONSTANT                             ~0      'baseController'
          1        FREE                                                     ~0
   53     2      > RETURN                                                   null

End of function __construct

Function edit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8o96R
function name:  edit
number of ops:  15
compiled vars:  !0 = $i, !1 = $tis
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     0  E >   RECV                                             !0      
   56     1        FETCH_OBJ_R                                      ~4      'model'
          2        INIT_METHOD_CALL                                         ~4, 'userList'
          3        DO_FCALL                                      0  $5      
          4        FETCH_OBJ_W                                      $2      !1, 'view'
          5        ASSIGN_OBJ                                               $2, 'user'
          6        OP_DATA                                                  $5
   57     7        FETCH_OBJ_R                                      ~6      'view'
          8        INIT_METHOD_CALL                                         ~6, 'render'
          9        FETCH_CONSTANT                                   ~7      'user'
         10        FETCH_CONSTANT                                   ~8      'edit'
         11        DIV                                              ~9      ~7, ~8
         12        SEND_VAL_EX                                              ~9
         13        DO_FCALL                                      0          
   58    14      > RETURN                                                   null

End of function edit

Function echoview:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8o96R
function name:  echoView
number of ops:  6
compiled vars:  !0 = $view
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        FETCH_OBJ_R                                      ~1      'view'
          2        INIT_METHOD_CALL                                         ~1, 'render'
          3        SEND_VAL_EX                                              'views%2Fheader'
          4        DO_FCALL                                      0          
   19     5      > RETURN                                                   null

End of function echoview

End of class userController.

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

End of function __construct

Function userlist:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8o96R
function name:  userList
number of ops:  11
compiled vars:  !0 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   69     0  E >   FETCH_OBJ_R                                      ~1      'db'
          1        INIT_METHOD_CALL                                         ~1, 'prepare'
          2        SEND_VAL_EX                                              'SELECET+users+FROM...'
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !0, $2
   70     5        INIT_METHOD_CALL                                         !0, 'execute'
          6        DO_FCALL                                      0          
   71     7        INIT_METHOD_CALL                                         !0, 'fetchAll'
          8        DO_FCALL                                      0  $5      
          9      > RETURN                                                   $5
   72    10*     > RETURN                                                   null

End of function userlist

End of class userModel.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.22 ms | 1403 KiB | 13 Q