3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (true) { function test_func1($string) { return $string; } $value = test_func1("defined before"); } echo $value; echo "\n---\n"; if (true) { $value = test_func2("defined after"); function test_func2($string) { return $string; } } echo $value;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 6
Branch analysis from position: 1
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 6
filename:       /in/oo9iu
function name:  (null)
number of ops:  16
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > JMPZ                                                     <true>, ->6
    4     1    >   DECLARE_FUNCTION                                         'test_func1'
    7     2        INIT_FCALL_BY_NAME                                       'test_func1'
          3        SEND_VAL_EX                                              'defined+before'
          4        DO_FCALL                                      0  $1      
          5        ASSIGN                                                   !0, $1
    9     6    >   ECHO                                                     !0
   11     7        ECHO                                                     '%0A---%0A'
   13     8      > JMPZ                                                     <true>, ->14
   14     9    >   INIT_FCALL_BY_NAME                                       'test_func2'
         10        SEND_VAL_EX                                              'defined+after'
         11        DO_FCALL                                      0  $3      
         12        ASSIGN                                                   !0, $3
   15    13        DECLARE_FUNCTION                                         'test_func2'
   19    14    >   ECHO                                                     !0
   20    15      > RETURN                                                   1

Function %00test_func1%2Fin%2Foo9iu%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oo9iu
function name:  test_func1
number of ops:  3
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1      > RETURN                                                   !0
    6     2*     > RETURN                                                   null

End of function %00test_func1%2Fin%2Foo9iu%3A4%240

Function %00test_func2%2Fin%2Foo9iu%3A15%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oo9iu
function name:  test_func2
number of ops:  3
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1      > RETURN                                                   !0
   17     2*     > RETURN                                                   null

End of function %00test_func2%2Fin%2Foo9iu%3A15%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.61 ms | 1395 KiB | 13 Q