3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public $i = 1; public function foo($num) { return ($num + 1); } public function increment() { if($quantity = $this->foo($this->i) > 0) { echo $this->i = ($quantity + 1); } } } $test = new a(); $test->increment(); $test->increment();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ta6JH
function name:  (null)
number of ops:  8
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'a'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_METHOD_CALL                                         !0, 'increment'
          4        DO_FCALL                                      0          
   23     5        INIT_METHOD_CALL                                         !0, 'increment'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class a:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ta6JH
function name:  foo
number of ops:  4
compiled vars:  !0 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ADD                                              ~1      !0, 1
          2      > RETURN                                                   ~1
    9     3*     > RETURN                                                   null

End of function foo

Function increment:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/Ta6JH
function name:  increment
number of ops:  13
compiled vars:  !0 = $quantity
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_METHOD_CALL                                         'foo'
          1        CHECK_FUNC_ARG                                           
          2        FETCH_OBJ_FUNC_ARG                               $1      'i'
          3        SEND_FUNC_ARG                                            $1
          4        DO_FCALL                                      0  $2      
          5        IS_SMALLER                                       ~3      0, $2
          6        ASSIGN                                           ~4      !0, ~3
          7      > JMPZ                                                     ~4, ->12
   15     8    >   ADD                                              ~6      !0, 1
          9        ASSIGN_OBJ                                       ~5      'i'
         10        OP_DATA                                                  ~6
         11        ECHO                                                     ~5
   17    12    > > RETURN                                                   null

End of function increment

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.26 ms | 1395 KiB | 13 Q