3v4l.org

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

Function %00test_func1%2Fin%2FF2ZZa%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F2ZZa
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%2FF2ZZa%3A4%240

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

End of function %00test_func2%2Fin%2FF2ZZa%3A14%241

Function %00test_func3%2Fin%2FF2ZZa%3A23%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F2ZZa
function name:  test_func3
number of ops:  3
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   24     1      > RETURN                                                   !0
   25     2*     > RETURN                                                   null

End of function %00test_func3%2Fin%2FF2ZZa%3A23%242

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.63 ms | 1403 KiB | 13 Q