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($s) { echo $s; } function speak($s) { } function look($l) { echo $l; } //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($s) { parent::__construct($s); } //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(); } } $h = new baseController("Im in the base"); $home = new userController("I went through the user!");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Iiht
function name:  (null)
number of ops:  9
compiled vars:  !0 = $h, !1 = $home
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   83     0  E >   NEW                                              $2      'baseController'
          1        SEND_VAL_EX                                              'Im+in+the+base'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   84     4        NEW                                              $5      'userController'
          5        SEND_VAL_EX                                              'I+went+through+the+user%21'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
          8      > RETURN                                                   1

Class baseController:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Iiht
function name:  __construct
number of ops:  3
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        ECHO                                                     !0
   15     2      > RETURN                                                   null

End of function __construct

Function speak:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Iiht
function name:  speak
number of ops:  2
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1      > RETURN                                                   null

End of function speak

Function look:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Iiht
function name:  look
number of ops:  3
compiled vars:  !0 = $l
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        ECHO                                                     !0
   22     2      > RETURN                                                   null

End of function look

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/4Iiht
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     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/4Iiht
function name:  __construct
number of ops:  5
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   59     0  E >   RECV                                             !0      
   60     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   61     4      > RETURN                                                   null

End of function __construct

Function speak:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Iiht
function name:  speak
number of ops:  2
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1      > RETURN                                                   null

End of function speak

Function look:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Iiht
function name:  look
number of ops:  3
compiled vars:  !0 = $l
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        ECHO                                                     !0
   22     2      > RETURN                                                   null

End of function look

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/4Iiht
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   73     0  E >   INIT_STATIC_METHOD_CALL                                  
          1        DO_FCALL                                      0          
   74     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/4Iiht
function name:  userList
number of ops:  11
compiled vars:  !0 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   77     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
   78     5        INIT_METHOD_CALL                                         !0, 'execute'
          6        DO_FCALL                                      0          
   79     7        INIT_METHOD_CALL                                         !0, 'fetchAll'
          8        DO_FCALL                                      0  $5      
          9      > RETURN                                                   $5
   80    10*     > RETURN                                                   null

End of function userlist

End of class userModel.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.59 ms | 1399 KiB | 13 Q