3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.73 ms | 1394 KiB | 17 Q