3v4l.org

run code in 300+ PHP versions simultaneously
<?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 = false; $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 == ']') { $depth--; if ($depth === $jump) { $jump = 0; $this->stack(); } } } 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 = true; } 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); foreach ($this->getCallStack() as $call) { echo '#'.$i.' '.$call['command'].' ('.$call['internal_function'],') on pos '.$call['pos'].PHP_EOL; } 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 { echo "{ "; $c->execute($bf); echo " }"; } 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; $i = 0; foreach ($c->getCallStack() as $call) { echo '#'.$i.' '.$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
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 77) Position 1 = 44, Position 2 = 58
Branch analysis from position: 44
2 jumps found. (Code = 78) Position 1 = 45, Position 2 = 58
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 58
Branch analysis from position: 6
Found catch point at position: 16
Branch analysis from position: 16
2 jumps found. (Code = 107) Position 1 = 17, Position 2 = -2
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 44, Position 2 = 58
Branch analysis from position: 44
Branch analysis from position: 58
filename:       /in/OpuaD
function name:  (null)
number of ops:  61
compiled vars:  !0 = $c, !1 = $bf, !2 = $e, !3 = $i, !4 = $call
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, ->6
    4     5    >   DECLARE_CLASS                                            'runtimeexception', 'exception'
  192     6    >   NEW                                              $7      'Compiler'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !0, $7
  194     9        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'
  202    10        ECHO                                                     '%7B+'
  203    11        INIT_METHOD_CALL                                         !0, 'execute'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0          
  204    14        ECHO                                                     '+%7D'
         15      > JMP                                                      ->23
  206    16  E > > CATCH                                       last         'Exception'
  207    17    >   ECHO                                                     '%0AAn+exception+was+thrown+whilst+processing+your+BF+program.%0A'
  208    18        INIT_METHOD_CALL                                         !2, 'getMessage'
         19        DO_FCALL                                      0  $12     
         20        CONCAT                                           ~13     $12, '%3A'
         21        CONCAT                                           ~14     ~13, '%0A'
         22        ECHO                                                     ~14
  210    23    >   INIT_METHOD_CALL                                         !0, 'getPointer'
         24        DO_FCALL                                      0  $15     
         25        CONCAT                                           ~16     'The+pointer+was+set+to+', $15
         26        CONCAT                                           ~17     ~16, '+and+the+cell+array+resembled%3A'
         27        CONCAT                                           ~18     ~17, '%0A'
         28        ECHO                                                     ~18
  211    29        INIT_FCALL                                               'implode'
         30        SEND_VAL                                                 '%2C+'
         31        INIT_METHOD_CALL                                         !0, 'getCells'
         32        DO_FCALL                                      0  $19     
         33        SEND_VAR                                                 $19
         34        DO_ICALL                                         $20     
         35        CONCAT                                           ~21     '%5B', $20
         36        CONCAT                                           ~22     ~21, '%5D'
         37        CONCAT                                           ~23     ~22, '%0A'
         38        ECHO                                                     ~23
  212    39        ECHO                                                     'The+current+stack+trace+was%3A%0A'
  213    40        ASSIGN                                                   !3, 0
  214    41        INIT_METHOD_CALL                                         !0, 'getCallStack'
         42        DO_FCALL                                      0  $25     
         43      > FE_RESET_R                                       $26     $25, ->58
         44    > > FE_FETCH_R                                               $26, !4, ->58
  215    45    >   CONCAT                                           ~27     '%23', !3
         46        CONCAT                                           ~28     ~27, '+'
         47        FETCH_DIM_R                                      ~29     !4, 'command'
         48        CONCAT                                           ~30     ~28, ~29
         49        CONCAT                                           ~31     ~30, '+%28'
         50        FETCH_DIM_R                                      ~32     !4, 'internal_function'
         51        CONCAT                                           ~33     ~31, ~32
         52        ECHO                                                     ~33
         53        FETCH_DIM_R                                      ~34     !4, 'pos'
         54        CONCAT                                           ~35     '%29+on+pos+', ~34
         55        CONCAT                                           ~36     ~35, '%0A'
         56        ECHO                                                     ~36
  214    57      > JMP                                                      ->44
         58    >   FE_FREE                                                  $26
  217    59        ECHO                                                     '%0AFinished.%0A'
  218    60      > RETURN                                                   1

Class RuntimeException: [no user functions]
Class InvalidStateException: [no user functions]
Class Compiler:
Function parsestring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 6
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 6
Branch analysis from position: 26
Branch analysis from position: 6
Branch analysis from position: 21
filename:       /in/OpuaD
function name:  parseString
number of ops:  27
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                                                      ->22
   19     6    >   INIT_FCALL                                               'substr'
          7        FETCH_OBJ_R                                      ~6      'code'
          8        SEND_VAL                                                 ~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_VAL                                                 ~9
         17        DO_ICALL                                         $10     
         18        BOOL_NOT                                         ~11     $10
         19      > JMPZ                                                     ~11, ->21
   21    20    > > JMP                                                      ->21
   18    21    >   PRE_INC                                                  !2
         22    >   FETCH_OBJ_R                                      ~13     'code'
         23        STRLEN                                           ~14     ~13
         24        IS_SMALLER                                               !2, ~14
         25      > JMPNZ                                                    ~15, ->6
   24    26    > > RETURN                                                   null

End of function parsestring

Function execute:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 116
Branch analysis from position: 116
2 jumps found. (Code = 44) Position 1 = 121, Position 2 = 13
Branch analysis from position: 121
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 115
Branch analysis from position: 115
2 jumps found. (Code = 44) Position 1 = 121, Position 2 = 13
Branch analysis from position: 121
Branch analysis from position: 13
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 50
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 41
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 49
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 49
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 115
Branch analysis from position: 115
Branch analysis from position: 49
Branch analysis from position: 49
Branch analysis from position: 41
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 55
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 115
Branch analysis from position: 115
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 60
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 115
Branch analysis from position: 115
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 65
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 115
Branch analysis from position: 115
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 70
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 115
Branch analysis from position: 115
Branch analysis from position: 70
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 75
Branch analysis from position: 72
1 jumps found. (Code = 42) Position 1 = 115
Branch analysis from position: 115
Branch analysis from position: 75
2 jumps found. (Code = 43) Position 1 = 77, Position 2 = 83
Branch analysis from position: 77
1 jumps found. (Code = 42) Position 1 = 115
Branch analysis from position: 115
Branch analysis from position: 83
2 jumps found. (Code = 43) Position 1 = 85, Position 2 = 99
Branch analysis from position: 85
2 jumps found. (Code = 43) Position 1 = 87, Position 2 = 92
Branch analysis from position: 87
1 jumps found. (Code = 42) Position 1 = 98
Branch analysis from position: 98
1 jumps found. (Code = 42) Position 1 = 115
Branch analysis from position: 115
Branch analysis from position: 92
1 jumps found. (Code = 42) Position 1 = 115
Branch analysis from position: 115
Branch analysis from position: 99
2 jumps found. (Code = 43) Position 1 = 101, Position 2 = 115
Branch analysis from position: 101
2 jumps found. (Code = 43) Position 1 = 103, Position 2 = 110
Branch analysis from position: 103
1 jumps found. (Code = 42) Position 1 = 115
Branch analysis from position: 115
Branch analysis from position: 110
1 jumps found. (Code = 42) Position 1 = 115
Branch analysis from position: 115
Branch analysis from position: 115
filename:       /in/OpuaD
function name:  execute
number of ops:  122
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, <false>
   31     8        ASSIGN                                                   !2, <array>
   32     9        ASSIGN                                                   !3, 0
   34    10        ASSIGN_OBJ                                               'i'
         11        OP_DATA                                                  0
         12      > JMP                                                      ->116
   35    13    >   INIT_FCALL                                               'substr'
         14        FETCH_OBJ_R                                      ~14     'code'
         15        SEND_VAL                                                 ~14
         16        FETCH_OBJ_R                                      ~15     'i'
         17        SEND_VAL                                                 ~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_VAL                                                 ~22
         31        DO_ICALL                                         $23     
         32        BOOL_NOT                                         ~24     $23
         33      > JMPZ                                                     ~24, ->36
   38    34    > > JMP                                                      ->115
         35*       JMP                                                      ->115
   40    36    >   IS_SMALLER                                               0, !1
         37      > JMPZ                                                     ~25, ->50
   41    38    >   IS_EQUAL                                                 !4, '%5B'
         39      > JMPZ                                                     ~26, ->41
   42    40    >   PRE_INC                                                  !3
   44    41    >   IS_EQUAL                                                 !4, '%5D'
         42      > JMPZ                                                     ~28, ->49
   45    43    >   PRE_DEC                                                  !3
   46    44        IS_IDENTICAL                                             !3, !1
         45      > JMPZ                                                     ~30, ->49
   47    46    >   ASSIGN                                                   !1, 0
   48    47        INIT_METHOD_CALL                                         'stack'
         48        DO_FCALL                                      0          
         49    > > JMP                                                      ->115
   53    50    >   IS_EQUAL                                                 !4, '%3E'
         51      > JMPZ                                                     ~33, ->55
   54    52    >   INIT_METHOD_CALL                                         'increment_pointer'
         53        DO_FCALL                                      0          
         54      > JMP                                                      ->115
   56    55    >   IS_EQUAL                                                 !4, '%3C'
         56      > JMPZ                                                     ~35, ->60
   57    57    >   INIT_METHOD_CALL                                         'decrement_pointer'
         58        DO_FCALL                                      0          
         59      > JMP                                                      ->115
   59    60    >   IS_EQUAL                                                 !4, '%2B'
         61      > JMPZ                                                     ~37, ->65
   60    62    >   INIT_METHOD_CALL                                         'increment_val'
         63        DO_FCALL                                      0          
         64      > JMP                                                      ->115
   62    65    >   IS_EQUAL                                                 !4, '-'
         66      > JMPZ                                                     ~39, ->70
   63    67    >   INIT_METHOD_CALL                                         'decrement_val'
         68        DO_FCALL                                      0          
         69      > JMP                                                      ->115
   65    70    >   IS_EQUAL                                                 !4, '.'
         71      > JMPZ                                                     ~41, ->75
   66    72    >   INIT_METHOD_CALL                                         'output_val'
         73        DO_FCALL                                      0          
         74      > JMP                                                      ->115
   68    75    >   IS_EQUAL                                                 !4, '%2C'
         76      > JMPZ                                                     ~43, ->83
   69    77    >   INIT_METHOD_CALL                                         'store_val'
         78        INIT_METHOD_CALL                                         'input_val'
         79        DO_FCALL                                      0  $44     
         80        SEND_VAR_NO_REF_EX                                       $44
         81        DO_FCALL                                      0          
         82      > JMP                                                      ->115
   71    83    >   IS_EQUAL                                                 !4, '%5B'
         84      > JMPZ                                                     ~46, ->99
   72    85    >   IS_EQUAL                                                 !5, 0
         86      > JMPZ                                                     ~47, ->92
   73    87    >   INIT_METHOD_CALL                                         'stack'
         88        SEND_VAL_EX                                              'jump'
         89        DO_FCALL                                      0          
   74    90        ASSIGN                                                   !1, <true>
         91      > JMP                                                      ->98
   77    92    >   INIT_FCALL                                               'array_push'
         93        SEND_REF                                                 !2
         94        FETCH_OBJ_R                                      ~50     'i'
         95        SEND_VAL                                                 ~50
         96        DO_ICALL                                                 
   78    97        PRE_INC                                                  !3
         98    > > JMP                                                      ->115
   81    99    >   IS_EQUAL                                                 !4, '%5D'
        100      > JMPZ                                                     ~53, ->115
   82   101    >   IS_SMALLER                                               0, !5
        102      > JMPZ                                                     ~54, ->110
   83   103    >   COUNT                                            ~56     !2
        104        SUB                                              ~57     ~56, 1
        105        FETCH_DIM_R                                      ~58     !2, ~57
        106        ASSIGN_OBJ                                               'i'
        107        OP_DATA                                                  ~58
   84   108      > JMP                                                      ->115
        109*       JMP                                                      ->115
   87   110    >   INIT_FCALL                                               'array_pop'
        111        SEND_REF                                                 !2
        112        DO_ICALL                                                 
   88   113        PRE_DEC                                                  !3
   89   114      > JMP                                                      ->115
   34   115    >   PRE_INC_OBJ                                              'i'
        116    >   FETCH_OBJ_R                                      ~62     'i'
        117        FETCH_OBJ_R                                      ~63     'code'
        118        STRLEN                                           ~64     ~63
        119        IS_SMALLER                                               ~62, ~64
        120      > JMPNZ                                                    ~65, ->13
   94   121    > > RETURN                                                   null

End of function execute

Function stack:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 32, Position 2 = 46
Branch analysis from position: 32
2 jumps found. (Code = 78) Position 1 = 33, Position 2 = 46
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
filename:       /in/OpuaD
function name:  stack
number of ops:  49
compiled vars:  !0 = $func, !1 = $info, !2 = $call, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   96     0  E >   RECV_INIT                                        !0      null
   97     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~4, ->18
   98     3    >   FETCH_OBJ_R                                      ~5      'call_stack'
          4        COUNT                                            ~6      ~5
          5        IS_EQUAL                                                 ~6, 0
          6      > JMPZ                                                     ~7, ->12
   99     7    >   NEW                                              $8      'InvalidStateException'
          8        SEND_VAL_EX                                              'Trying+to+pop+empty+call+stack'
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $8
  100    11*       RETURN                                                   <false>
  102    12    >   INIT_FCALL                                               'array_pop'
         13        FETCH_OBJ_W                                      $10     'call_stack'
         14        SEND_REF                                                 $10
         15        DO_ICALL                                                 
  103    16      > RETURN                                                   <true>
         17*       JMP                                                      ->48
  106    18    >   FETCH_OBJ_R                                      ~12     'c'
         19        INIT_ARRAY                                       ~13     ~12, 'command'
         20        FETCH_OBJ_R                                      ~14     'i'
         21        ADD_ARRAY_ELEMENT                                ~13     ~14, 'pos'
         22        ADD_ARRAY_ELEMENT                                ~13     !0, 'internal_function'
         23        ASSIGN                                                   !1, ~13
  107    24        INIT_FCALL                                               'array_push'
         25        FETCH_OBJ_W                                      $16     'call_stack'
         26        SEND_REF                                                 $16
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                                 
  108    29        INIT_METHOD_CALL                                         'getCallStack'
         30        DO_FCALL                                      0  $18     
         31      > FE_RESET_R                                       $19     $18, ->46
         32    > > FE_FETCH_R                                               $19, !2, ->46
  109    33    >   CONCAT                                           ~20     '%23', !3
         34        CONCAT                                           ~21     ~20, '+'
         35        FETCH_DIM_R                                      ~22     !2, 'command'
         36        CONCAT                                           ~23     ~21, ~22
         37        CONCAT                                           ~24     ~23, '+%28'
         38        FETCH_DIM_R                                      ~25     !2, 'internal_function'
         39        CONCAT                                           ~26     ~24, ~25
         40        ECHO                                                     ~26
         41        FETCH_DIM_R                                      ~27     !2, 'pos'
         42        CONCAT                                           ~28     '%29+on+pos+', ~27
         43        CONCAT                                           ~29     ~28, '%0A'
         44        ECHO                                                     ~29
  108    45      > JMP                                                      ->32
         46    >   FE_FREE                                                  $19
  112    47      > RETURN                                                   <true>
  114    48*     > RETURN                                                   null

End of function stack

Function minimum_cellsize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OpuaD
function name:  minimum_cellsize
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  117     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      $2, -1
          7      > RETURN                                                   ~3
  118     8*     > RETURN                                                   null

End of function minimum_cellsize

Function maximum_cellsize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OpuaD
function name:  maximum_cellsize
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  121     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
  122     8*     > RETURN                                                   null

End of function maximum_cellsize

Function increment_pointer:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/OpuaD
function name:  increment_pointer
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  125     0  E >   INIT_METHOD_CALL                                         'stack'
          1        SEND_VAL                                                 'increment_pointer'
          2        DO_FCALL                                      0          
  126     3        PRE_INC_OBJ                                              'ptr'
  127     4        FETCH_OBJ_R                                      ~3      'ptr'
          5        FETCH_OBJ_IS                                     ~2      'arr'
          6        ISSET_ISEMPTY_DIM_OBJ                         0  ~4      ~2, 

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.2 ms | 1428 KiB | 27 Q