3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); 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 = 7, Position 2 = 22
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fdrUl
function name:  (null)
number of ops:  28
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                                                     'Checking+if+__DIR__+is+defined...%0A'
    5     4        DEFINED                                          ~1      '__DIR__'
          5        BOOL_NOT                                         ~2      ~1
          6      > JMPZ                                                     ~2, ->22
    6     7    >   ECHO                                                     'Nope%2C+defined%28%29+returned+%28bool%29false.%0A'
    8     8        ECHO                                                     'No+prob.+Executing+define%28%27__DIR__%27%2C+%27%2Ffoo%2Fbar%27%29...%0A'
    9     9        INIT_FCALL                                               'define'
         10        SEND_VAL                                                 '__DIR__'
         11        SEND_VAL                                                 '%2Ffoo%2Fbar'
         12        DO_ICALL                                                 
   11    13        ECHO                                                     'Done%2C+defined+__DIR__+as+%22%2Ffoo%2Fbar%22.%0A%0A'
   13    14        ECHO                                                     'Double-checking+__DIR__+is+defined+now...%0A'
   15    15        DEFINED                                          ~4      '__DIR__'
         16        BOOL_NOT                                         ~5      ~4
         17      > JMPZ                                                     ~5, ->20
   16    18    >   ECHO                                                     'WTF%2C+defined%28%27__DIR__%27%29+again+returned+%28bool%29false%3F%21%0A'
         19      > JMP                                                      ->21
   18    20    >   ECHO                                                     'Strike%2C+this+time+defined%28%27__DIR__%27%29+returned+%28bool%29true.%0A'
         21    > > JMP                                                      ->23
   21    22    >   ECHO                                                     'Yep%2C+defined%28%27__DIR__%27%29+returned+%28bool%29true.%0A'
   24    23    >   ECHO                                                     'Finally%2C+here+is+the+result+of+var_dump%28__DIR__%29%3A%0A'
   25    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAL                                                 '%2Fin'
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.64 ms | 1396 KiB | 19 Q