3v4l.org

run code in 300+ PHP versions simultaneously
<?php function returnVariable(){ $foo = 1; try{ return $foo; } finally { $foo++; debug_zval_dump($foo); } } function returnVariablePlusZero(){ $foo = 1; try{ return $foo + 0; } finally { $foo++; } } var_dump(returnVariable(), returnVariablePlusZero());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XmDgF
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'returnvariable'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        INIT_FCALL                                               'returnvariablepluszero'
          5        DO_FCALL                                      0  $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function returnvariable:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 162) Position 1 = 6, Position 2 = 3
Branch analysis from position: 6
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XmDgF
function name:  returnVariable
number of ops:  12
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 1
    6     1        QM_ASSIGN                                        ~3      !0
          2      > FAST_CALL                                                ->6
          3    > > RETURN                                                   ~3
    7     4*       FAST_CALL                                                ->6
          5*       JMP                                                      ->11
    8     6    >   PRE_INC                                                  !0
    9     7        INIT_FCALL                                               'debug_zval_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > FAST_RET                                                 
   11    11*     > RETURN                                                   null

End of function returnvariable

Function returnvariablepluszero:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 162) Position 1 = 6, Position 2 = 3
Branch analysis from position: 6
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XmDgF
function name:  returnVariablePlusZero
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, 1
   16     1        ADD                                              ~3      !0, 0
          2      > FAST_CALL                                                ->6
          3    > > RETURN                                                   ~3
   17     4*       FAST_CALL                                                ->6
          5*       JMP                                                      ->8
   18     6    >   PRE_INC                                                  !0
          7      > FAST_RET                                                 
   20     8*     > RETURN                                                   null

End of function returnvariablepluszero

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.46 ms | 1399 KiB | 19 Q