3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.88 ms | 1395 KiB | 21 Q