3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('A', 1); if(defined('A')) { function a() { echo "hello from `".__FUNCTION__."`\n"; } } if(defined('B')) { function b() { echo "hello from `".__FUNCTION__."`\n"; } } echo function_exists("b") ? "b is defined\n" : "b is not defined\n"; a(); echo function_exists("b") ? "b is defined\n" : "b is not defined\n"; b(); a(); echo function_exists("b") ? "b is defined\n" : "b is not defined\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
Branch analysis from position: 38
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
Branch analysis from position: 26
Branch analysis from position: 10
Branch analysis from position: 7
filename:       /in/p9b0e
function name:  (null)
number of ops:  41
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'A'
          2        SEND_VAL                                                 1
          3        DO_ICALL                                                 
    5     4        DEFINED                                                  'A'
          5      > JMPZ                                                     ~1, ->7
    6     6    >   DECLARE_FUNCTION                                         'a'
   11     7    >   DEFINED                                                  'B'
          8      > JMPZ                                                     ~2, ->10
   12     9    >   DECLARE_FUNCTION                                         'b'
   17    10    >   INIT_FCALL                                               'function_exists'
         11        SEND_VAL                                                 'b'
         12        DO_ICALL                                         $3      
         13      > JMPZ                                                     $3, ->16
         14    >   QM_ASSIGN                                        ~4      'b+is+defined%0A'
         15      > JMP                                                      ->17
         16    >   QM_ASSIGN                                        ~4      'b+is+not+defined%0A'
         17    >   ECHO                                                     ~4
   18    18        INIT_FCALL_BY_NAME                                       'a'
         19        DO_FCALL                                      0          
   19    20        INIT_FCALL                                               'function_exists'
         21        SEND_VAL                                                 'b'
         22        DO_ICALL                                         $6      
         23      > JMPZ                                                     $6, ->26
         24    >   QM_ASSIGN                                        ~7      'b+is+defined%0A'
         25      > JMP                                                      ->27
         26    >   QM_ASSIGN                                        ~7      'b+is+not+defined%0A'
         27    >   ECHO                                                     ~7
   20    28        INIT_FCALL_BY_NAME                                       'b'
         29        DO_FCALL                                      0          
   22    30        INIT_FCALL_BY_NAME                                       'a'
         31        DO_FCALL                                      0          
   23    32        INIT_FCALL                                               'function_exists'
         33        SEND_VAL                                                 'b'
         34        DO_ICALL                                         $10     
         35      > JMPZ                                                     $10, ->38
         36    >   QM_ASSIGN                                        ~11     'b+is+defined%0A'
         37      > JMP                                                      ->39
         38    >   QM_ASSIGN                                        ~11     'b+is+not+defined%0A'
         39    >   ECHO                                                     ~11
         40      > RETURN                                                   1

Function %00a%2Fin%2Fp9b0e%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p9b0e
function name:  a
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'hello+from+%60a%60%0A'
    8     1      > RETURN                                                   null

End of function %00a%2Fin%2Fp9b0e%3A6%240

Function %00b%2Fin%2Fp9b0e%3A12%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p9b0e
function name:  b
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'hello+from+%60b%60%0A'
   14     1      > RETURN                                                   null

End of function %00b%2Fin%2Fp9b0e%3A12%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.72 ms | 1400 KiB | 17 Q