3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $count = 4; public function getNext() { if (!$this->count) { return null; } --$this->count; return 'next'; } } $a = new Test(); for ($i = 0; $i < 10; $i++) { var_dump($a->count); var_dump($this->getNext() ?: 'none'); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 5
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 5
Branch analysis from position: 20
Branch analysis from position: 5
filename:       /in/veoRd
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   20     3        ASSIGN                                                   !1, 0
          4      > JMP                                                      ->18
   21     5    >   INIT_FCALL                                               'var_dump'
          6        FETCH_OBJ_R                                      ~6      !0, 'count'
          7        SEND_VAL                                                 ~6
          8        DO_ICALL                                                 
   22     9        INIT_FCALL                                               'var_dump'
         10        FETCH_THIS                                       $8      
         11        INIT_METHOD_CALL                                         $8, 'getNext'
         12        DO_FCALL                                      0  $9      
         13        JMP_SET                                          ~10     $9, ->15
         14        QM_ASSIGN                                        ~10     'none'
         15        SEND_VAL                                                 ~10
         16        DO_ICALL                                                 
   20    17        PRE_INC                                                  !1
         18    >   IS_SMALLER                                               !1, 10
         19      > JMPNZ                                                    ~13, ->5
   23    20    > > RETURN                                                   1

Class Test:
Function getnext:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/veoRd
function name:  getNext
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'count'
          1        BOOL_NOT                                         ~1      ~0
          2      > JMPZ                                                     ~1, ->4
    9     3    > > RETURN                                                   null
   12     4    >   PRE_DEC_OBJ                                              'count'
   14     5      > RETURN                                                   'next'
   15     6*     > RETURN                                                   null

End of function getnext

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.06 ms | 1396 KiB | 15 Q