3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Note extends CI_Controller { /*************************** Note CRUD ***************************/ // list records function notes_records() { $data = array(); if($query = $this->note_model->get_records()) { $data['records'] = $query; } $this->load->view('note', $data); } // note create function create() { if($_POST) { $data = array( 'title' => $this->input->post('title'), 'note' => $this->input->post('note') ); $this->note_model->add_record($data); redirect('site/members_area'); } else { $data['main_content'] = 'create_note'; $this->load->view('includes/template', $data); } } // edit form function edit() { if($query = $this->note_model->get_edit()) { $data['records'] = $query; } $data['main_content'] = 'note_edit'; $this->load->view('includes/template', $data); } // update data function update() { $data = array( 'title' => $this->input->post('title'), 'note' => $this->input->post('note') ); $this->note_model->update_record($data); redirect('site/members_area'); } // delete note function delete() { $this->note_model->delete_record(); redirect('site/members_area'); } /*************************** CATEGORY ***************************/ // create category function create_category() { $this->load->helper('form'); $this->load->library(array('form_validation')); // set validation rules $this->form_validation->set_rules('category_name', 'Name', 'required|max_length[200]|xss_clean'); if ($this->form_validation->run() == FALSE) { //if not valid $data['main_content'] = 'create_category'; $this->load->view('includes/template', $data); } else { //if valid $data = array( 'cat_title' => $this->input->post('category_name') ); $this->note_model->create_category($data); redirect('site/members_area'); } } // list notes by category`s function category_records() { if($query = $this->note_model->get_category()) { $data['records'] = $query; } if($query_note = $this->note_model->get_records()) { $data['notes_by_category'] = $query_note; } $data['main_content'] = 'category'; $this->load->view('includes/template', $data); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QuuWE
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'note', 'ci_controller'
  116     1      > RETURN                                                   1

Class Note:
Function notes_records:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/QuuWE
function name:  notes_records
number of ops:  14
compiled vars:  !0 = $data, !1 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, <array>
   13     1        FETCH_OBJ_R                                      ~3      'note_model'
          2        INIT_METHOD_CALL                                         ~3, 'get_records'
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                           ~5      !1, $4
          5      > JMPZ                                                     ~5, ->8
   15     6    >   ASSIGN_DIM                                               !0, 'records'
          7        OP_DATA                                                  !1
   17     8    >   FETCH_OBJ_R                                      ~7      'load'
          9        INIT_METHOD_CALL                                         ~7, 'view'
         10        SEND_VAL_EX                                              'note'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0          
   18    13      > RETURN                                                   null

End of function notes_records

Function create:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 21
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QuuWE
function name:  create
number of ops:  29
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   FETCH_R                      global              ~1      '_POST'
          1      > JMPZ                                                     ~1, ->21
   26     2    >   FETCH_OBJ_R                                      ~2      'input'
          3        INIT_METHOD_CALL                                         ~2, 'post'
          4        SEND_VAL_EX                                              'title'
          5        DO_FCALL                                      0  $3      
          6        INIT_ARRAY                                       ~4      $3, 'title'
   27     7        FETCH_OBJ_R                                      ~5      'input'
          8        INIT_METHOD_CALL                                         ~5, 'post'
          9        SEND_VAL_EX                                              'note'
         10        DO_FCALL                                      0  $6      
         11        ADD_ARRAY_ELEMENT                                ~4      $6, 'note'
   25    12        ASSIGN                                                   !0, ~4
   29    13        FETCH_OBJ_R                                      ~8      'note_model'
         14        INIT_METHOD_CALL                                         ~8, 'add_record'
         15        SEND_VAR_EX                                              !0
         16        DO_FCALL                                      0          
   30    17        INIT_FCALL_BY_NAME                                       'redirect'
         18        SEND_VAL_EX                                              'site%2Fmembers_area'
         19        DO_FCALL                                      0          
         20      > JMP                                                      ->28
   34    21    >   ASSIGN_DIM                                               !0, 'main_content'
         22        OP_DATA                                                  'create_note'
   35    23        FETCH_OBJ_R                                      ~12     'load'
         24        INIT_METHOD_CALL                                         ~12, 'view'
         25        SEND_VAL_EX                                              'includes%2Ftemplate'
         26        SEND_VAR_EX                                              !0
         27        DO_FCALL                                      0          
   38    28    > > RETURN                                                   null

End of function create

Function edit:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/QuuWE
function name:  edit
number of ops:  15
compiled vars:  !0 = $query, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   FETCH_OBJ_R                                      ~2      'note_model'
          1        INIT_METHOD_CALL                                         ~2, 'get_edit'
          2        DO_FCALL                                      0  $3      
          3        ASSIGN                                           ~4      !0, $3
          4      > JMPZ                                                     ~4, ->7
   45     5    >   ASSIGN_DIM                                               !1, 'records'
          6        OP_DATA                                                  !0
   47     7    >   ASSIGN_DIM                                               !1, 'main_content'
          8        OP_DATA                                                  'note_edit'
   48     9        FETCH_OBJ_R                                      ~7      'load'
         10        INIT_METHOD_CALL                                         ~7, 'view'
         11        SEND_VAL_EX                                              'includes%2Ftemplate'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0          
   49    14      > RETURN                                                   null

End of function edit

Function update:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QuuWE
function name:  update
number of ops:  19
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     0  E >   FETCH_OBJ_R                                      ~1      'input'
          1        INIT_METHOD_CALL                                         ~1, 'post'
          2        SEND_VAL_EX                                              'title'
          3        DO_FCALL                                      0  $2      
          4        INIT_ARRAY                                       ~3      $2, 'title'
   56     5        FETCH_OBJ_R                                      ~4      'input'
          6        INIT_METHOD_CALL                                         ~4, 'post'
          7        SEND_VAL_EX                                              'note'
          8        DO_FCALL                                      0  $5      
          9        ADD_ARRAY_ELEMENT                                ~3      $5, 'note'
   54    10        ASSIGN                                                   !0, ~3
   58    11        FETCH_OBJ_R                                      ~7      'note_model'
         12        INIT_METHOD_CALL                                         ~7, 'update_record'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0          
   59    15        INIT_FCALL_BY_NAME                                       'redirect'
         16        SEND_VAL_EX                                              'site%2Fmembers_area'
         17        DO_FCALL                                      0          
   60    18      > RETURN                                                   null

End of function update

Function delete:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QuuWE
function name:  delete
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   65     0  E >   FETCH_OBJ_R                                      ~0      'note_model'
          1        INIT_METHOD_CALL                                         ~0, 'delete_record'
          2        DO_FCALL                                      0          
   66     3        INIT_FCALL_BY_NAME                                       'redirect'
          4        SEND_VAL_EX                                              'site%2Fmembers_area'
          5        DO_FCALL                                      0          
   67     6      > RETURN                                                   null

End of function delete

Function create_category:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 27
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QuuWE
function name:  create_category
number of ops:  41
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   76     0  E >   FETCH_OBJ_R                                      ~1      'load'
          1        INIT_METHOD_CALL                                         ~1, 'helper'
          2        SEND_VAL_EX                                              'form'
          3        DO_FCALL                                      0          
   77     4        FETCH_OBJ_R                                      ~3      'load'
          5        INIT_METHOD_CALL                                         ~3, 'library'
          6        SEND_VAL_EX                                              <array>
          7        DO_FCALL                                      0          
   80     8        FETCH_OBJ_R                                      ~5      'form_validation'
          9        INIT_METHOD_CALL                                         ~5, 'set_rules'
         10        SEND_VAL_EX                                              'category_name'
         11        SEND_VAL_EX                                              'Name'
         12        SEND_VAL_EX                                              'required%7Cmax_length%5B200%5D%7Cxss_clean'
         13        DO_FCALL                                      0          
   82    14        FETCH_OBJ_R                                      ~7      'form_validation'
         15        INIT_METHOD_CALL                                         ~7, 'run'
         16        DO_FCALL                                      0  $8      
         17        BOOL_NOT                                         ~9      $8
         18      > JMPZ                                                     ~9, ->27
   85    19    >   ASSIGN_DIM                                               !0, 'main_content'
         20        OP_DATA                                                  'create_category'
   86    21        FETCH_OBJ_R                                      ~11     'load'
         22        INIT_METHOD_CALL                                         ~11, 'view'
         23        SEND_VAL_EX                                              'includes%2Ftemplate'
         24        SEND_VAR_EX                                              !0
         25        DO_FCALL                                      0          
         26      > JMP                                                      ->40
   92    27    >   FETCH_OBJ_R                                      ~13     'input'
         28        INIT_METHOD_CALL                                         ~13, 'post'
         29        SEND_VAL_EX                                              'category_name'
         30        DO_FCALL                                      0  $14     
         31        INIT_ARRAY                                       ~15     $14, 'cat_title'
   91    32        ASSIGN                                                   !0, ~15
   95    33        FETCH_OBJ_R                                      ~17     'note_model'
         34        INIT_METHOD_CALL                                         ~17, 'create_category'
         35        SEND_VAR_EX                                              !0
         36        DO_FCALL                                      0          
   96    37        INIT_FCALL_BY_NAME                                       'redirect'
         38        SEND_VAL_EX                                              'site%2Fmembers_area'
         39        DO_FCALL                                      0          
   98    40    > > RETURN                                                   null

End of function create_category

Function category_records:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 7
filename:       /in/QuuWE
function name:  category_records
number of ops:  22
compiled vars:  !0 = $query, !1 = $data, !2 = $query_note
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  103     0  E >   FETCH_OBJ_R                                      ~3      'note_model'
          1        INIT_METHOD_CALL                                         ~3, 'get_category'
          2        DO_FCALL                                      0  $4      
          3        ASSIGN                                           ~5      !0, $4
          4      > JMPZ                                                     ~5, ->7
  105     5    >   ASSIGN_DIM                                               !1, 'records'
          6        OP_DATA                                                  !0
  107     7    >   FETCH_OBJ_R                                      ~7      'note_model'
          8        INIT_METHOD_CALL                                         ~7, 'get_records'
          9        DO_FCALL                                      0  $8      
         10        ASSIGN                                           ~9      !2, $8
         11      > JMPZ                                                     ~9, ->14
  109    12    >   ASSIGN_DIM                                               !1, 'notes_by_category'
         13        OP_DATA                                                  !2
  111    14    >   ASSIGN_DIM                                               !1, 'main_content'
         15        OP_DATA                                                  'category'
  112    16        FETCH_OBJ_R                                      ~12     'load'
         17        INIT_METHOD_CALL                                         ~12, 'view'
         18        SEND_VAL_EX                                              'includes%2Ftemplate'
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0          
  114    21      > RETURN                                                   null

End of function category_records

End of class Note.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.4 ms | 1411 KiB | 13 Q