3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(defined('__DIR__')); if (!defined('__DIR__')) { echo 'ok'."\n"; define('__DIR__', dirname(__FILE__)); } else { echo 'nok'."\n"; } echo __DIR__;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Vpik
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        DEFINED                                          ~0      '__DIR__'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    4     4        DEFINED                                          ~2      '__DIR__'
          5        BOOL_NOT                                         ~3      ~2
          6      > JMPZ                                                     ~3, ->16
    5     7    >   ECHO                                                     'ok%0A'
    6     8        INIT_FCALL                                               'define'
          9        SEND_VAL                                                 '__DIR__'
         10        INIT_FCALL                                               'dirname'
         11        SEND_VAL                                                 '%2Fin%2F3Vpik'
         12        DO_ICALL                                         $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                                 
         15      > JMP                                                      ->17
    8    16    >   ECHO                                                     'nok%0A'
   11    17    >   ECHO                                                     '%2Fin'
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.32 ms | 1395 KiB | 19 Q