3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (@__DIR__ == '__DIR__') { echo "magic __DIR__ constant NOT defined\r\n"; echo "defining __DIR__ constant\r\n"; define('__DIR__', substr(__FILE__, 0, strrpos(__FILE__, DIRECTORY_SEPARATOR))); } else { echo "magic __DIR__ constant IS defined\r\n"; } echo "r\nresult of var_dump(__DIR__):\r\n"; var_dump(__DIR__);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QvpbH
function name:  (null)
number of ops:  25
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   BEGIN_SILENCE                                    ~0      
          1        END_SILENCE                                              ~0
          2      > JMPZ                                                     <false>, ->19
    3     3    >   ECHO                                                     'magic+__DIR__+constant+NOT+defined%0D%0A'
    4     4        ECHO                                                     'defining+__DIR__+constant%0D%0A'
    5     5        INIT_FCALL                                               'define'
          6        SEND_VAL                                                 '__DIR__'
          7        INIT_FCALL                                               'substr'
          8        SEND_VAL                                                 '%2Fin%2FQvpbH'
          9        SEND_VAL                                                 0
         10        INIT_FCALL                                               'strrpos'
         11        SEND_VAL                                                 '%2Fin%2FQvpbH'
         12        SEND_VAL                                                 '%2F'
         13        DO_ICALL                                         $1      
         14        SEND_VAR                                                 $1
         15        DO_ICALL                                         $2      
         16        SEND_VAR                                                 $2
         17        DO_ICALL                                                 
         18      > JMP                                                      ->20
    8    19    >   ECHO                                                     'magic+__DIR__+constant+IS+defined%0D%0A'
   10    20    >   ECHO                                                     'r%0Aresult+of+var_dump%28__DIR__%29%3A%0D%0A'
   11    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAL                                                 '%2Fin'
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.24 ms | 1395 KiB | 21 Q