3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($argument) { try { echo "try\n"; return $argument; } finally { $argument++; unset($argument); echo "finally\n"; } } $counter = 2; $result = test($counter); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0oTE9
function name:  (null)
number of ops:  9
compiled vars:  !0 = $counter, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, 2
   19     1        INIT_FCALL                                               'test'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
   20     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 162) Position 1 = 7, Position 2 = 4
Branch analysis from position: 7
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0oTE9
function name:  test
number of ops:  12
compiled vars:  !0 = $argument
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    7     1        ECHO                                                     'try%0A'
    8     2        QM_ASSIGN                                        ~2      !0
          3      > FAST_CALL                                                ->7
          4    > > RETURN                                                   ~2
   11     5*       FAST_CALL                                                ->7
          6*       JMP                                                      ->11
   12     7    >   PRE_INC                                                  !0
   13     8        UNSET_CV                                                 !0
   14     9        ECHO                                                     'finally%0A'
         10      > FAST_RET                                                 
   16    11*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.31 ms | 943 KiB | 17 Q