3v4l.org

run code in 300+ PHP versions simultaneously
<?php // In response to http://www.php.net/manual/en/language.constants.predefined.php#113130 // In fact, you can define magic constants too. 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 "result 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/tTmPj
function name:  (null)
number of ops:  25
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BEGIN_SILENCE                                    ~0      
          1        END_SILENCE                                              ~0
          2      > JMPZ                                                     <false>, ->19
    6     3    >   ECHO                                                     'magic+__DIR__+constant+NOT+defined%0D%0A'
    7     4        ECHO                                                     'defining+__DIR__+constant%0D%0A'
    8     5        INIT_FCALL                                               'define'
          6        SEND_VAL                                                 '__DIR__'
          7        INIT_FCALL                                               'substr'
          8        SEND_VAL                                                 '%2Fin%2FtTmPj'
          9        SEND_VAL                                                 0
         10        INIT_FCALL                                               'strrpos'
         11        SEND_VAL                                                 '%2Fin%2FtTmPj'
         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
   11    19    >   ECHO                                                     'magic+__DIR__+constant+IS+defined%0D%0A'
   13    20    >   ECHO                                                     'result+of+var_dump%28__DIR__%29%3A%0D%0A'
   14    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:
147.98 ms | 1395 KiB | 21 Q