3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); echo 'Here is __DIR__ to start: ' . "\n"; var_dump(__DIR__); echo "\n\n"; echo 'Checking if __DIR__ is defined...' . "\n"; if (!defined('__DIR__')) { echo 'Nope, defined() returned (bool)false.' . "\n"; echo 'No prob. Executing define(\'__DIR__\', \'/foo/bar\')...' . "\n"; define('__DIR__', '/foo/bar'); echo 'Done, defined __DIR__ as "/foo/bar".' . "\n" . "\n"; echo 'Double-checking __DIR__ is defined now...' . "\n"; if (!defined('__DIR__')) { echo 'WTF, defined(\'__DIR__\') again returned (bool)false?!' . "\n"; } else{ echo 'Strike, this time defined(\'__DIR__\') returned (bool)true.' . "\n"; } } else{ echo 'Yep, defined(\'__DIR__\') returned (bool)true.' . "\n"; } echo 'Finally, here is the result of var_dump(__DIR__):' . "\n"; var_dump(__DIR__);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 27
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ri9hB
function name:  (null)
number of ops:  33
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
    4     3        ECHO                                                     'Here+is+__DIR__+to+start%3A+%0A'
    5     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAL                                                 '%2Fin'
          6        DO_ICALL                                                 
    7     7        ECHO                                                     '%0A%0A'
    9     8        ECHO                                                     'Checking+if+__DIR__+is+defined...%0A'
   10     9        DEFINED                                          ~2      '__DIR__'
         10        BOOL_NOT                                         ~3      ~2
         11      > JMPZ                                                     ~3, ->27
   11    12    >   ECHO                                                     'Nope%2C+defined%28%29+returned+%28bool%29false.%0A'
   13    13        ECHO                                                     'No+prob.+Executing+define%28%27__DIR__%27%2C+%27%2Ffoo%2Fbar%27%29...%0A'
   14    14        INIT_FCALL                                               'define'
         15        SEND_VAL                                                 '__DIR__'
         16        SEND_VAL                                                 '%2Ffoo%2Fbar'
         17        DO_ICALL                                                 
   16    18        ECHO                                                     'Done%2C+defined+__DIR__+as+%22%2Ffoo%2Fbar%22.%0A%0A'
   18    19        ECHO                                                     'Double-checking+__DIR__+is+defined+now...%0A'
   20    20        DEFINED                                          ~5      '__DIR__'
         21        BOOL_NOT                                         ~6      ~5
         22      > JMPZ                                                     ~6, ->25
   21    23    >   ECHO                                                     'WTF%2C+defined%28%27__DIR__%27%29+again+returned+%28bool%29false%3F%21%0A'
         24      > JMP                                                      ->26
   23    25    >   ECHO                                                     'Strike%2C+this+time+defined%28%27__DIR__%27%29+returned+%28bool%29true.%0A'
         26    > > JMP                                                      ->28
   26    27    >   ECHO                                                     'Yep%2C+defined%28%27__DIR__%27%29+returned+%28bool%29true.%0A'
   29    28    >   ECHO                                                     'Finally%2C+here+is+the+result+of+var_dump%28__DIR__%29%3A%0A'
   30    29        INIT_FCALL                                               'var_dump'
         30        SEND_VAL                                                 '%2Fin'
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.94 ms | 1400 KiB | 19 Q