3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?PHP if (!class_exists('RuntimeException')) { class RuntimeException extends Exception { } } class InvalidStateException extends RuntimeException { } class Compiler { private $ptr; private $arr; private $code; private $commands = array('>', '<', '+', '-', '.', ',', '[', ']'); private $call_stack = array(); private $cellsize = 8; public function parseString($code, $throwException = true) { $this->code = $code; for ($i=0;$i<strlen($this->code);$i++) { $c = substr($this->code, $i, 1); if (!in_array($c, $this->commands)) { continue; } } } public function execute($code) { $this->arr = array(0 => 0); $this->ptr = 0; $this->code = $code; $jump = -1; $loop = array(); $depth = 0; for ($this->i=0;$this->i<strlen($this->code);$this->i++) { $c = $this->c = substr($this->code, $this->i, 1); $cell = $this->arr[$this->ptr]; if (!in_array($c, $this->commands)) { continue; } else if ($jump >= 0) { if ($c == '[') { $depth++; } if ($c == ']') { if ($depth === $jump) { $jump = -1; $this->stack(); } $depth--; } } else { if ($c == '>') { $this->increment_pointer(); } elseif ($c == '<') { $this->decrement_pointer(); } elseif ($c == '+') { $this->increment_val(); } elseif ($c == '-') { $this->decrement_val(); } elseif ($c == '.') { $this->output_val(); } elseif ($c == ',') { $this->store_val($this->input_val()); } elseif ($c == '[') { if ($cell == 0) { $this->stack('jump'); $jump = $depth; } else { array_push($loop, $this->i); $depth++; } } elseif ($c == ']') { if ($cell > 0) { $this->i = $loop[count($loop)-1]; continue; } else { array_pop($loop); $depth--; continue; } } } } } private function stack($func=null) { if (is_null($func)) { if (count($this->call_stack) == 0) { throw new InvalidStateException("Trying to pop empty call stack"); return false; } array_pop($this->call_stack); return true; } else { $info = array('command' => $this->c, 'pos' => $this->i, 'internal_function' => $func); array_push($this->call_stack, $info); return true; } } public function minimum_cellsize() { return (-1*(pow(2, $this->cellsize-1))); } public function maximum_cellsize() { return pow(2, $this->cellsize-1)-1; } private function increment_pointer() { $this->stack(__FUNCTION__); $this->ptr++; if (!isset($this->arr[$this->ptr])) $this->arr[$this->ptr] = 0; $this->stack(); return true; } private function decrement_pointer() { $this->stack(__FUNCTION__); $this->ptr--; if ($this->ptr < 0) { throw new InvalidStateException("The data pointer is less than 0"); return false; } $this->stack(); return true; } private function increment_val() { $x = $this->arr[$this->ptr]++; if ($x < $this->minimum_cellsize()) { $this->arr[$this->ptr] = $this->maximum_cellsize(); } elseif ($x > $this->maximum_cellsize()) { $this->arr[$this->ptr] = $this->minimum_cellsize(); } return true; } private function decrement_val() { $x = $this->arr[$this->ptr]--; if ($x < $this->minimum_cellsize()) { $this->arr[$this->ptr] = $this->maximum_cellsize(); } elseif ($x > $this->maximum_cellsize()) { $this->arr[$this->ptr] = $this->minimum_cellsize(); } return true; } private function output_val() { $c = $this->arr[$this->ptr]; echo ''.chr($c); } private function store_val($chr) { $x = ord($chr); $this->arr[$this->ptr] = $x; } private function input_val() { return fgets(STDIN); } public function getCallStack() { return $this->call_stack; } public function getCells() { return $this->arr; } public function getPointer() { return $this->ptr; } } $c = new Compiler(); $bf = ' >++++++++[<+++++++++>-]<.>>+>+>++>[-]+<[>[->+<<++++>]<<]>.+++++++..+++.> >+++++++.<<<[[-]<[-]>]<+++++++++++++++.>>.+++.------.--------.>>+.>++++. '; try { $c->execute($bf); } catch (Exception $e) { echo PHP_EOL."An exception was thrown whilst processing your BF program.".PHP_EOL; echo $e->getMessage().":".PHP_EOL; } echo "The pointer was set to ".$c->getPointer()." and the cell array resembled:".PHP_EOL; echo "[".implode(", ", $c->getCells())."]".PHP_EOL; echo "The current stack trace was:".PHP_EOL; foreach ($c->getCallStack() as $k => $call) { echo '#'.$k.' '.$call['command'].' ('.$call['internal_function'],') on pos '.$call['pos'].PHP_EOL; } echo PHP_EOL.'Finished.'.PHP_EOL; ?>
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
Jump found. Position 1 = 25
Branch analysis from position: 25
Jump found. Position 1 = 45, Position 2 = 60
Branch analysis from position: 45
Jump found. Position 1 = 46, Position 2 = 60
Branch analysis from position: 46
Jump found. Position 1 = 45
Branch analysis from position: 45
Branch analysis from position: 60
Jump found. Position 1 = -2
Branch analysis from position: 60
Branch analysis from position: 7
Found catch point at position: 18
Branch analysis from position: 18
Jump found. Position 1 = 19, Position 2 = -2
Branch analysis from position: 19
Jump found. Position 1 = 45, Position 2 = 60
Branch analysis from position: 45
Branch analysis from position: 60
filename:       /in/v1BA0
function name:  (null)
number of ops:  63
compiled vars:  !0 = $c, !1 = $bf, !2 = $e, !3 = $call, !4 = $k
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   INIT_FCALL                                               'class_exists'
         1        SEND_VAL                                                 'RuntimeException'
         2        DO_ICALL                                         $5      
         3        BOOL_NOT                                         ~6      $5
         4      > JMPZ                                                     ~6, ->7
   4     5    >   FETCH_CLASS                                   0  :7      'Exception'
         6        DECLARE_INHERITED_CLASS                          $8      '%00runtimeexception%2Fin%2Fv1BA00x7f8dcc43b05c', 'runtimeexception'
   6     7    >   NOP                                                      
         8        NOP                                                      
   8     9        NOP                                                      
 189    10        NEW                                              $12     :2
        11        DO_FCALL                                      0          
        12        ASSIGN                                                   !0, $12
 196    13        ASSIGN                                                   !1, '%0A%0A%3E%2B%2B%2B%2B%2B%2B%2B%2B%5B%3C%2B%2B%2B%2B%2B%2B%2B%2B%2B%3E-%5D%3C.%3E%3E%2B%3E%2B%3E%2B%2B%3E%5B-%5D%2B%3C%5B%3E%5B-%3E%2B%3C%3C%2B%2B%2B%2B%3E%5D%3C%3C%5D%3E.%2B%2B%2B%2B%2B%2B%2B..%2B%2B%2B.%3E%0A%3E%2B%2B%2B%2B%2B%2B%2B.%3C%3C%3C%5B%5B-%5D%3C%5B-%5D%3E%5D%3C%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B%2B.%3E%3E.%2B%2B%2B.------.--------.%3E%3E%2B.%3E%2B%2B%2B%2B.%0A%0A'
 199    14        INIT_METHOD_CALL                                         !0, 'execute'
        15        SEND_VAR_EX                                              !1
        16        DO_FCALL                                      0          
        17      > JMP                                                      ->25
 201    18  E > > CATCH                                                    'Exception', !2
 202    19    >   ECHO                                                     '%0AAn+exception+was+thrown+whilst+processing+your+BF+program.%0A'
 203    20        INIT_METHOD_CALL                                         !2, 'getMessage'
        21        DO_FCALL                                      0  $17     
        22        CONCAT                                           ~18     $17, '%3A'
        23        CONCAT                                           ~19     ~18, '%0A'
        24        ECHO                                                     ~19
 205    25    >   INIT_METHOD_CALL                                         !0, 'getPointer'
        26        DO_FCALL                                      0  $20     
        27        CONCAT                                           ~21     'The+pointer+was+set+to+', $20
        28        CONCAT                                           ~22     ~21, '+and+the+cell+array+resembled%3A'
        29        CONCAT                                           ~23     ~22, '%0A'
        30        ECHO                                                     ~23
 206    31        INIT_FCALL                                               'implode'
        32        SEND_VAL                                                 '%2C+'
        33        INIT_METHOD_CALL                                         !0, 'getCells'
        34        DO_FCALL                                      0  $24     
        35        SEND_VAR                                                 $24
        36        DO_ICALL                                         $25     
        37        CONCAT                                           ~26     '%5B', $25
        38        CONCAT                                           ~27     ~26, '%5D'
        39        CONCAT                                           ~28     ~27, '%0A'
        40        ECHO                                                     ~28
 207    41        ECHO                                                     'The+current+stack+trace+was%3A%0A'
 208    42        INIT_METHOD_CALL                                         !0, 'getCallStack'
        43        DO_FCALL                                      0  $29     
        44      > FE_RESET_R                                       $30     $29, ->60
        45    > > FE_FETCH_R                                               $30, !3, ->60
        46    >   ASSIGN                                                   !4, ~31
 209    47        CONCAT                                           ~33     '%23', !4
        48        CONCAT                                           ~34     ~33, '+'
        49        FETCH_DIM_R                                      $35     !3, 'command'
        50        CONCAT                                           ~36     ~34, $35
        51        CONCAT                                           ~37     ~36, '+%28'
        52        FETCH_DIM_R                                      $38     !3, 'internal_function'
        53        CONCAT                                           ~39     ~37, $38
        54        ECHO                                                     ~39
        55        FETCH_DIM_R                                      $40     !3, 'pos'
        56        CONCAT                                           ~41     '%29+on+pos+', $40
        57        CONCAT                                           ~42     ~41, '%0A'
        58        ECHO                                                     ~42
        59      > JMP                                                      ->45
        60    >   FE_FREE                                                  $30
 211    61        ECHO                                                     '%0AFinished.%0A'
        62      > RETURN                                                   1

Class RuntimeException: [no user functions]
Class InvalidStateException: [no user functions]
Class Compiler:
Function parsestring:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 23
Branch analysis from position: 23
Jump found. Position 1 = 27, Position 2 = 6
Branch analysis from position: 27
Jump found. Position 1 = -2
Branch analysis from position: 6
Jump found. Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
Jump found. Position 1 = 21
Branch analysis from position: 21
Jump found. Position 1 = 27, Position 2 = 6
Branch analysis from position: 27
Branch analysis from position: 6
Branch analysis from position: 21
filename:       /in/v1BA0
function name:  parseString
number of ops:  28
compiled vars:  !0 = $code, !1 = $throwException, !2 = $i, !3 = $c
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  16     0  E >   RECV                                             !0      
         1        RECV_INIT                                        !1      <true>
  17     2        ASSIGN_OBJ                                               'code'
         3        OP_DATA                                                  !0
  18     4        ASSIGN                                                   !2, 0
         5      > JMP                                                      ->23
  19     6    >   INIT_FCALL                                               'substr'
         7        FETCH_OBJ_R                                      $6      'code'
         8        SEND_VAR                                                 $6
         9        SEND_VAR                                                 !2
        10        SEND_VAL                                                 1
        11        DO_ICALL                                         $7      
        12        ASSIGN                                                   !3, $7
  20    13        INIT_FCALL                                               'in_array'
        14        SEND_VAR                                                 !3
        15        FETCH_OBJ_R                                      $9      'commands'
        16        SEND_VAR                                                 $9
        17        DO_ICALL                                         $10     
        18        BOOL_NOT                                         ~11     $10
        19      > JMPZ                                                     ~11, ->21
  21    20    > > JMP                                                      ->21
  18    21    >   POST_INC                                         ~12     !2
        22        FREE                                                     ~12
        23    >   FETCH_OBJ_R                                      $13     'code'
        24        STRLEN                                           ~14     $13
        25        IS_SMALLER                                       ~15     !2, ~14
        26      > JMPNZ                                                    ~15, ->6
  24    27    > > RETURN                                                   null

End of function parsestring

Function execute:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 123
Branch analysis from position: 123
Jump found. Position 1 = 128, Position 2 = 13
Branch analysis from position: 128
Jump found. Position 1 = -2
Branch analysis from position: 13
Jump found. Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
Jump found. Position 1 = 121
Branch analysis from position: 121
Jump found. Position 1 = 128, Position 2 = 13
Branch analysis from position: 128
Branch analysis from position: 13
Branch analysis from position: 36
Jump found. Position 1 = 38, Position 2 = 52
Branch analysis from position: 38
Jump found. Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
Jump found. Position 1 = 44, Position 2 = 51
Branch analysis from position: 44
Jump found. Position 1 = 46, Position 2 = 49
Branch analysis from position: 46
Jump found. Position 1 = 121
Branch analysis from position: 121
Branch analysis from position: 49
Branch analysis from position: 51
Branch analysis from position: 42
Branch analysis from position: 52
Jump found. Position 1 = 54, Position 2 = 57
Branch analysis from position: 54
Jump found. Position 1 = 121
Branch analysis from position: 121
Branch analysis from position: 57
Jump found. Position 1 = 59, Position 2 = 62
Branch analysis from position: 59
Jump found. Position 1 = 121
Branch analysis from position: 121
Branch analysis from position: 62
Jump found. Position 1 = 64, Position 2 = 67
Branch analysis from position: 64
Jump found. Position 1 = 121
Branch analysis from position: 121
Branch analysis from position: 67
Jump found. Position 1 = 69, Position 2 = 72
Branch analysis from position: 69
Jump found. Position 1 = 121
Branch analysis from position: 121
Branch analysis from position: 72
Jump found. Position 1 = 74, Position 2 = 77
Branch analysis from position: 74
Jump found. Position 1 = 121
Branch analysis from position: 121
Branch analysis from position: 77
Jump found. Position 1 = 79, Position 2 = 85
Branch analysis from position: 79
Jump found. Position 1 = 121
Branch analysis from position: 121
Branch analysis from position: 85
Jump found. Position 1 = 87, Position 2 = 102
Branch analysis from position: 87
Jump found. Position 1 = 89, Position 2 = 94
Branch analysis from position: 89
Jump found. Position 1 = 101
Branch analysis from position: 101
Jump found. Position 1 = 121
Branch analysis from position: 121
Branch analysis from position: 94
Jump found. Position 1 = 121
Branch analysis from position: 121
Branch analysis from position: 102
Jump found. Position 1 = 104, Position 2 = 121
Branch analysis from position: 104
Jump found. Position 1 = 106, Position 2 = 115
Branch analysis from position: 106
Jump found. Position 1 = 121
Branch analysis from position: 121
Branch analysis from position: 115
Jump found. Position 1 = 121
Branch analysis from position: 121
Branch analysis from position: 121
filename:       /in/v1BA0
function name:  execute
number of ops:  129
compiled vars:  !0 = $code, !1 = $jump, !2 = $loop, !3 = $depth, !4 = $c, !5 = $cell
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  26     0  E >   RECV                                             !0      
  27     1        ASSIGN_OBJ                                               'arr'
         2        OP_DATA                                                  <array>
  28     3        ASSIGN_OBJ                                               'ptr'
         4        OP_DATA                                                  0
  29     5        ASSIGN_OBJ                                               'code'
         6        OP_DATA                                                  !0
  30     7        ASSIGN                                                   !1, -1
  31     8        ASSIGN                                                   !2, <array>
  32     9        ASSIGN                                                   !3, 0
  34    10        ASSIGN_OBJ                                               'i'
        11        OP_DATA                                                  0
        12      > JMP                                                      ->123
  35    13    >   INIT_FCALL                                               'substr'
        14        FETCH_OBJ_R                                      $14     'code'
        15        SEND_VAR                                                 $14
        16        FETCH_OBJ_R                                      $15     'i'
        17        SEND_VAR                                                 $15
        18        SEND_VAL                                                 1
        19        DO_ICALL                                         $16     
        20        ASSIGN_OBJ                                       $13     'c'
        21        OP_DATA                                                  $16
        22        ASSIGN                                                   !4, $13
  36    23        FETCH_OBJ_R                                      $19     'ptr'
        24        FETCH_OBJ_R                                      $18     'arr'
        25        FETCH_DIM_R                                      $20     $18, $19
        26        ASSIGN                                                   !5, $20
  37    27        INIT_FCALL                                               'in_array'
        28        SEND_VAR                                                 !4
        29        FETCH_OBJ_R                                      $22     'commands'
        30        SEND_VAR                                                 $22
        31        DO_ICALL                                         $23     
        32        BOOL_NOT                                         ~24     $23
        33      > JMPZ                                                     ~24, ->36
  38    34    > > JMP                                                      ->121
        35*       JMP                                                      ->121
  40    36    >   IS_SMALLER_OR_EQUAL                              ~25     0, !1
        37      > JMPZ                                                     ~25, ->52
  41    38    >   IS_EQUAL                                         ~26     !4, '%5B'
        39      > JMPZ                                                     ~26, ->42
  42    40    >   POST_INC                                         ~27     !3
        41        FREE                                                     ~27
  44    42    >   IS_EQUAL                                         ~28     !4, '%5D'
        43      > JMPZ                                                     ~28, ->51
  45    44    >   IS_IDENTICAL                                     ~29     !3, !1
        45      > JMPZ                                                     ~29, ->49
  46    46    >   ASSIGN                                                   !1, -1
  47    47        INIT_METHOD_CALL                                         'stack'
        48        DO_FCALL                                      0          
  49    49    >   POST_DEC                                         ~32     !3
        50        FREE                                                     ~32
        51    > > JMP                                                      ->121
  53    52    >   IS_EQUAL                                         ~33     !4, '%3E'
        53      > JMPZ                                                     ~33, ->57
  54    54    >   INIT_METHOD_CALL                                         'increment_pointer'
        55        DO_FCALL                                      0          
        56      > JMP                                                      ->121
  56    57    >   IS_EQUAL                                         ~35     !4, '%3C'
        58      > JMPZ                                                     ~35, ->62
  57    59    >   INIT_METHOD_CALL                                         'decrement_pointer'
        60        DO_FCALL                                      0          
        61      > JMP                                                      ->121
  59    62    >   IS_EQUAL                                         ~37     !4, '%2B'
        63      > JMPZ                                                     ~37, ->67
  60    64    >   INIT_METHOD_CALL                                         'increment_val'
        65        DO_FCALL                                      0          
        66      > JMP                                                      ->121
  62    67    >   IS_EQUAL                                         ~39     !4, '-'
        68      > JMPZ                                                     ~39, ->72
  63    69    >   INIT_METHOD_CALL                                         'decrement_val'
        70        DO_FCALL                                      0          
        71      > JMP                                                      ->121
  65    72    >   IS_EQUAL                                         ~41     !4, '.'
        73      > JMPZ                                                     ~41, ->77
  66    74    >   INIT_METHOD_CALL                                         'output_val'
        75        DO_FCALL                                      0          
        76      > JMP                                                      ->121
  68    77    >   IS_EQUAL                                         ~43     !4, '%2C'
        78      > JMPZ                                                     ~43, ->85
  69    79    >   INIT_METHOD_CALL                                         'store_val'
        80        INIT_METHOD_CALL                                         'input_val'
        81        DO_FCALL                                      0  $44     
        82        SEND_VAR_NO_REF                               4          $44
        83        DO_FCALL                                      0          
        84      > JMP                                                      ->121
  71    85    >   IS_EQUAL                                         ~46     !4, '%5B'
        86      > JMPZ                                                     ~46, ->102
  72    87    >   IS_EQUAL                                         ~47     !5, 0
        88      > JMPZ                                                     ~47, ->94
  73    89    >   INIT_METHOD_CALL                                         'stack'
        90        SEND_VAL_EX                                              'jump'
        91        DO_FCALL                                      0          
  74    92        ASSIGN                                                   !1, !3
        93      > JMP                                                      ->101
  77    94    >   INIT_FCALL                                               'array_push'
        95        SEND_REF                                                 !2
        96        FETCH_OBJ_R                                      $50     'i'
        97        SEND_VAR                                                 $50
        98        DO_ICALL                                                 
  78    99        POST_INC                                         ~52     !3
       100        FREE                                                     ~52
       101    > > JMP                                                      ->121
  81   102    >   IS_EQUAL                                         ~53     !4, '%5D'
       103      > JMPZ                                                     ~53, ->121
  82   104    >   IS_SMALLER                                       ~54     0, !5
       105      > JMPZ                                                     ~54, ->115
  83   106    >   INIT_FCALL                                               'count'
       107        SEND_VAR                                                 !2
       108        DO_ICALL                                         $56     
       109        SUB                                              ~57     $56, 1
       110        FETCH_DIM_R                                      $58     !2, ~57
       111        ASSIGN_OBJ                                               'i'
       112        OP_DATA                                                  $58
  84   113      > JMP                                                      ->121
       114*       JMP                                                      ->121
  87   115    >   INIT_FCALL                                               'array_pop'
       116        SEND_REF                                                 !2
       117        DO_ICALL                                                 
  88   118        POST_DEC                                         ~60     !3
       119        FREE                                                     ~60
  89   120      > JMP                                                      ->121
  34   121    >   POST_INC_OBJ                                     ~61     'i'
       122        FREE                                                     ~61
       123    >   FETCH_OBJ_R                                      $62     'i'
       124        FETCH_OBJ_R                                      $63     'code'
       125        STRLEN                                           ~64     $63
       126        IS_SMALLER                                       ~65     $62, ~64
       127      > JMPNZ                                                    ~65, ->13
  94   128    > > RETURN                                                   null

End of function execute

Function stack:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
Jump found. Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
Jump found. Position 1 = -2
Branch analysis from position: 14
Jump found. Position 1 = -2
Branch analysis from position: 20
Jump found. Position 1 = -2
filename:       /in/v1BA0
function name:  stack
number of ops:  33
compiled vars:  !0 = $func, !1 = $info
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  96     0  E >   RECV_INIT                                        !0      null
  97     1        TYPE_CHECK                                    1  ~2      !0
         2      > JMPZ                                                     ~2, ->20
  98     3    >   INIT_FCALL                                               'count'
         4        FETCH_OBJ_R                                      $3      'call_stack'
         5        SEND_VAR                                                 $3
         6        DO_ICALL                                         $4      
         7        IS_EQUAL                                         ~5      $4, 0
         8      > JMPZ                                                     ~5, ->14
  99     9    >   NEW                                              $6      :-2
        10        SEND_VAL_EX                                              'Trying+to+pop+empty+call+stack'
        11        DO_FCALL                                      0          
        12      > THROW                                         0          $6
 100    13*       RETURN                                                   <false>
 102    14    >   INIT_FCALL                                               'array_pop'
        15        FETCH_OBJ_W                                      $8      'call_stack'
        16        SEND_REF                                                 $8
        17        DO_ICALL                                                 
 103    18      > RETURN                                                   <true>
        19*       JMP                                                      ->32
 106    20    >   FETCH_OBJ_R                                      $10     'c'
        21        INIT_ARRAY                                       ~11     $10, 'command'
        22        FETCH_OBJ_R                                      $12     'i'
        23        ADD_ARRAY_ELEMENT                                ~11     $12, 'pos'
        24        ADD_ARRAY_ELEMENT                                ~11     !0, 'internal_function'
        25        ASSIGN                                                   !1, ~11
 107    26        INIT_FCALL                                               'array_push'
        27        FETCH_OBJ_W                                      $14     'call_stack'
        28        SEND_REF                                                 $14
        29        SEND_VAR                                                 !1
        30        DO_ICALL                                                 
 109    31      > RETURN                                                   <true>
 111    32*     > RETURN                                                   null

End of function stack

Function minimum_cellsize:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/v1BA0
function name:  minimum_cellsize
number of ops:  9
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
 114     0  E >   INIT_FCALL                                               'pow'
         1        SEND_VAL                                                 2
         2        FETCH_OBJ_R                                      $0      'cellsize'
         3        SUB                                              ~1      $0, 1
         4        SEND_VAL                                                 ~1
         5        DO_ICALL                                         $2      
         6        MUL                                              ~3      -1, $2
         7      > RETURN                                                   ~3
 115     8*     > RETURN                                                   null

End of function minimum_cellsize

Function maximum_cellsize:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/v1BA0
function name:  maximum_cellsize
number of ops:  9
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
 118     0  E >   INIT_FCALL                                               'pow'
         1        SEND_VAL                                                 2
         2        FETCH_OBJ_R                                      $0      'cellsize'
         3        SUB                                              ~1      $0, 1
         4        SEND_VAL                                                 ~1
         5        DO_ICALL                                         $2      
         6        SUB                                              ~3      $2, 1
         7      > RETURN                                                   ~3
 119     8*     > RETURN                                                   null

End of function maximum_cellsize

Function increment_pointer:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
Jump found. Position 1 = -2
Branch analysis from position: 14
filename:       /in/v1BA0
function name:  increment_pointer
number of ops:  18
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
 122     0  E >   INIT_METHOD_CALL                                         'stack'
         1        SEND_VAL_EX                                              'increment_pointer'
         2        DO_FCALL                                      0          
 123     3        POST_INC_OBJ                                     ~1      'ptr'
         4        FREE                                                     ~1
 124     5        FETCH_OBJ_R                                      $3      'ptr'
         6        FETCH_OBJ_IS                                     $2      'arr'
         7        ISSET_ISEMPTY_DIM_OBJ                       33554432  ~4      $2, $3
         8        BOOL_NOT                                         ~5      ~4
         9      > JMPZ                                                     ~5, ->14
        10    >   FETCH_OBJ_R                                      $7      'ptr'
        11        FETCH_OBJ_W                                      $6      'arr'
        12        ASSIGN_DIM                                               $6, $7
        13        OP_DATA                                                  0
 125    14    >   INIT_METHOD_CALL                                         'stack'
        15        DO_FCALL                                      0          
 126    16      > RETURN                                                   <true>
 127    17*     > RETURN                                                   null

End of function increment_pointer

Function decrement_pointer:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
Jump found. Position 1 = -2
Branch analysis from position: 13
Jump found. Position 1 = -2
filename:       /in/v1BA0
function name:  decrement_pointer
number of ops:  17
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
 130     0  E >   INIT_METHOD_CALL                                         'stack'
         1        SEND_VAL_EX                                              'decrement_pointer'
         2        DO_FCALL                                      0          
 131     3        POST_DEC_OBJ                                     ~1      'ptr'
         4        FREE                                                     ~1
 132     5        FETCH_OBJ_R                                      $2      'ptr'
         6        IS_SMALLER                                       ~3      $2, 0
         7      > JMPZ              

Generated using Vulcan Logic Dumper, using php 7.3.0