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 $quantity . "\n"; $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/vAmfA
function name:  (null)
number of ops:  8
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'a'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'increment'
          4        DO_FCALL                                      0          
   24     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/vAmfA
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 = 13
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/vAmfA
function name:  increment
number of ops:  14
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, ->13
   15     8    >   CONCAT                                           ~5      !0, '%0A'
          9        ECHO                                                     ~5
   16    10        ADD                                              ~7      !0, 1
         11        ASSIGN_OBJ                                               'i'
         12        OP_DATA                                                  ~7
   18    13    > > RETURN                                                   null

End of function increment

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.19 ms | 1395 KiB | 13 Q