3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); echo 'Testing on PHP version ' . PHP_VERSION . PHP_EOL . PHP_EOL; echo 'Checking if "__DIR__" is defined.' . PHP_EOL; if (!defined('__DIR__')) { echo 'No, "__DIR__" is not defined. Defining it now.' . PHP_EOL; define('__DIR__', 'bar'); echo 'Checking again if "__DIR__" is defined.' . PHP_EOL; if (!defined('__DIR__')) { echo 'Damn! *Seems like* "__DIR__" is still not defined.' . PHP_EOL; } else{ echo 'Strike, "__DIR__" is defined now.' . PHP_EOL; } echo 'Anyway, here is what `var_dump(__DIR__)` returns:' . PHP_EOL; var_dump(__DIR__); } else{ echo 'Yep, "__DIR__" is defined.' . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 25
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C7RSg
function name:  (null)
number of ops:  27
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                                                     'Testing+on+PHP+version+8.0.0%0A%0A'
    5     4        ECHO                                                     'Checking+if+%22__DIR__%22+is+defined.%0A'
    6     5        DEFINED                                          ~1      '__DIR__'
          6        BOOL_NOT                                         ~2      ~1
          7      > JMPZ                                                     ~2, ->25
    7     8    >   ECHO                                                     'No%2C+%22__DIR__%22+is+not+defined.+Defining+it+now.%0A'
    8     9        INIT_FCALL                                               'define'
         10        SEND_VAL                                                 '__DIR__'
         11        SEND_VAL                                                 'bar'
         12        DO_ICALL                                                 
   10    13        ECHO                                                     'Checking+again+if+%22__DIR__%22+is+defined.%0A'
   11    14        DEFINED                                          ~4      '__DIR__'
         15        BOOL_NOT                                         ~5      ~4
         16      > JMPZ                                                     ~5, ->19
   12    17    >   ECHO                                                     'Damn%21+%2ASeems+like%2A+%22__DIR__%22+is+still+not+defined.%0A'
         18      > JMP                                                      ->20
   14    19    >   ECHO                                                     'Strike%2C+%22__DIR__%22+is+defined+now.%0A'
   17    20    >   ECHO                                                     'Anyway%2C+here+is+what+%60var_dump%28__DIR__%29%60+returns%3A%0A'
   18    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAL                                                 '%2Fin'
         23        DO_ICALL                                                 
         24      > JMP                                                      ->26
   20    25    >   ECHO                                                     'Yep%2C+%22__DIR__%22+is+defined.%0A'
   21    26    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.3 ms | 1396 KiB | 19 Q