3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { const max =5; protected $_c = 0; public function tst() { $this->_c = ($this->_c + 1) % self::max; if ($this->_c === 0) echo '!'.PHP_EOL; } } $t = new test(); for ($i=0; $i<16; $i++) { echo $i; $t->tst(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
Branch analysis from position: 5
filename:       /in/KQBoA
function name:  (null)
number of ops:  12
compiled vars:  !0 = $t, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $2      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   18     3        ASSIGN                                                   !1, 0
          4      > JMP                                                      ->9
   19     5    >   ECHO                                                     !1
   20     6        INIT_METHOD_CALL                                         !0, 'tst'
          7        DO_FCALL                                      0          
   18     8        PRE_INC                                                  !1
          9    >   IS_SMALLER                                               !1, 16
         10      > JMPNZ                                                    ~8, ->5
   21    11    > > RETURN                                                   1

Class test:
Function tst:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/KQBoA
function name:  tst
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                      ~1      '_c'
          1        ADD                                              ~2      ~1, 1
          2        MOD                                              ~3      ~2, 5
          3        ASSIGN_OBJ                                               '_c'
          4        OP_DATA                                                  ~3
   10     5        FETCH_OBJ_R                                      ~4      '_c'
          6        IS_IDENTICAL                                             ~4, 0
          7      > JMPZ                                                     ~5, ->9
   11     8    >   ECHO                                                     '%21%0A'
   12     9    > > RETURN                                                   null

End of function tst

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.78 ms | 1394 KiB | 13 Q