3v4l.org

run code in 500+ PHP versions simultaneously
<?php function scope(){ try{ return $a = 'a'; } finally{ echo '$a was assigned to '.$a."\r\n"; } } $a = scope(); echo 'Function returned '.$a;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PiOFX
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                                   'scope'
          1        DO_FCALL                                          0  $1      
          2        ASSIGN                                                       !0, $1
   13     3        CONCAT                                               ~3      'Function+returned+', !0
          4        ECHO                                                         ~3
   14     5      > RETURN                                                       1

Function scope:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 162) Position 1 = 5, Position 2 = 2
Branch analysis from position: 5
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PiOFX
function name:  scope
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                               ~2      !0, 'a'
          1      > FAST_CALL                                                    ->5
          2    > > RETURN                                                       ~2
    7     3*       FAST_CALL                                                    ->5
          4*       JMP                                                          ->9
    8     5    >   CONCAT                                               ~3      '%24a+was+assigned+to+', !0
          6        CONCAT                                               ~4      ~3, '%0D%0A'
          7        ECHO                                                         ~4
          8      > FAST_RET                                                     
   10     9*     > RETURN                                                       null

End of function scope

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.78 ms | 2105 KiB | 14 Q