3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('A', 1); define('B', 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 = 10, Position 2 = 11
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
Branch analysis from position: 42
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
Branch analysis from position: 30
Branch analysis from position: 14
Branch analysis from position: 11
filename:       /in/gOI3O
function name:  (null)
number of ops:  45
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                                                 
    4     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 'B'
          6        SEND_VAL                                                 1
          7        DO_ICALL                                                 
    6     8        DEFINED                                                  'A'
          9      > JMPZ                                                     ~2, ->11
    7    10    >   DECLARE_FUNCTION                                         'a'
   12    11    >   DEFINED                                                  'B'
         12      > JMPZ                                                     ~3, ->14
   13    13    >   DECLARE_FUNCTION                                         'b'
   18    14    >   INIT_FCALL                                               'function_exists'
         15        SEND_VAL                                                 'b'
         16        DO_ICALL                                         $4      
         17      > JMPZ                                                     $4, ->20
         18    >   QM_ASSIGN                                        ~5      'b+is+defined%0A'
         19      > JMP                                                      ->21
         20    >   QM_ASSIGN                                        ~5      'b+is+not+defined%0A'
         21    >   ECHO                                                     ~5
   19    22        INIT_FCALL_BY_NAME                                       'a'
         23        DO_FCALL                                      0          
   20    24        INIT_FCALL                                               'function_exists'
         25        SEND_VAL                                                 'b'
         26        DO_ICALL                                         $7      
         27      > JMPZ                                                     $7, ->30
         28    >   QM_ASSIGN                                        ~8      'b+is+defined%0A'
         29      > JMP                                                      ->31
         30    >   QM_ASSIGN                                        ~8      'b+is+not+defined%0A'
         31    >   ECHO                                                     ~8
   21    32        INIT_FCALL_BY_NAME                                       'b'
         33        DO_FCALL                                      0          
   23    34        INIT_FCALL_BY_NAME                                       'a'
         35        DO_FCALL                                      0          
   24    36        INIT_FCALL                                               'function_exists'
         37        SEND_VAL                                                 'b'
         38        DO_ICALL                                         $11     
         39      > JMPZ                                                     $11, ->42
         40    >   QM_ASSIGN                                        ~12     'b+is+defined%0A'
         41      > JMP                                                      ->43
         42    >   QM_ASSIGN                                        ~12     'b+is+not+defined%0A'
         43    >   ECHO                                                     ~12
         44      > RETURN                                                   1

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

End of function %00a%2Fin%2FgOI3O%3A7%240

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

End of function %00b%2Fin%2FgOI3O%3A13%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
191.68 ms | 1405 KiB | 17 Q