3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Record { private $index=0; //page index private $pages=[]; //pages array public function nextPage() { $this->index++; } public function addRecord($key, $value) { $this->$pages[$this->index][$key] = $value; } public function getPage($index) { if ($index > $this->index) return NULL; else return $this->pages[$this->index]; } } $r = new Record(); $r->addRecord("t","m"); var_dump($r->getPage(0));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MQMgP
function name:  (null)
number of ops:  14
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'Record'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'addRecord'
          4        SEND_VAL_EX                                              't'
          5        SEND_VAL_EX                                              'm'
          6        DO_FCALL                                      0          
   24     7        INIT_FCALL                                               'var_dump'
          8        INIT_METHOD_CALL                                         !0, 'getPage'
          9        SEND_VAL_EX                                              0
         10        DO_FCALL                                      0  $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class Record:
Function nextpage:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MQMgP
function name:  nextPage
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   PRE_INC_OBJ                                              'index'
   10     1      > RETURN                                                   null

End of function nextpage

Function addrecord:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MQMgP
function name:  addRecord
number of ops:  8
compiled vars:  !0 = $key, !1 = $value, !2 = $pages
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        FETCH_OBJ_R                                      ~4      'index'
          3        FETCH_OBJ_W                                      $3      !2
          4        FETCH_DIM_W                                      $5      $3, ~4
          5        ASSIGN_DIM                                               $5, !0
          6        OP_DATA                                                  !1
   13     7      > RETURN                                                   null

End of function addrecord

Function getpage:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MQMgP
function name:  getPage
number of ops:  11
compiled vars:  !0 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        FETCH_OBJ_R                                      ~1      'index'
          2        IS_SMALLER                                               ~1, !0
          3      > JMPZ                                                     ~2, ->6
   16     4    > > RETURN                                                   null
          5*       JMP                                                      ->10
   18     6    >   FETCH_OBJ_R                                      ~4      'index'
          7        FETCH_OBJ_R                                      ~3      'pages'
          8        FETCH_DIM_R                                      ~5      ~3, ~4
          9      > RETURN                                                   ~5
   19    10*     > RETURN                                                   null

End of function getpage

End of class Record.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.1 ms | 1400 KiB | 15 Q