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() { echo "baseController says ". $string ."<br />"; } //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($i) { //$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($string); } //function edit() { // $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(); } } //$home = new baseController("Im in the base"); $home = new userController("Im just a user");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EYZ9J
function name:  (null)
number of ops:  5
compiled vars:  !0 = $home
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   76     0  E >   NEW                                              $1      'userController'
          1        SEND_VAL_EX                                              'Im+just+a+user'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
          4      > RETURN                                                   1

Class baseController:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EYZ9J
function name:  __construct
number of ops:  4
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   CONCAT                                           ~1      'baseController+says+', !0
          1        CONCAT                                           ~2      ~1, '%3Cbr+%2F%3E'
          2        ECHO                                                     ~2
   15     3      > RETURN                                                   null

End of function __construct

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/EYZ9J
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

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/EYZ9J
function name:  __construct
number of ops:  4
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   52     0  E >   INIT_STATIC_METHOD_CALL                                  'baseController'
          1        SEND_VAR_EX                                              !0
          2        DO_FCALL                                      0          
   53     3      > RETURN                                                   null

End of function __construct

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/EYZ9J
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/EYZ9J
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:
155.61 ms | 1390 KiB | 13 Q