3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); function php_const_dir() { $posix = ('/' == DIRECTORY_SEPARATOR) ? true : false; $path = substr(__FILE__, 0, strrpos(__FILE__, DIRECTORY_SEPARATOR)); return !$posix ? str_replace('\\', '/', rtrim($path, '/\\')) : rtrim($path, '/'); } function php_const_eol() { switch (strtoupper(substr(PHP_OS, 0, 3))) { // Windows case 'WIN': return "\r\n"; break; // Mac case 'DAR': return "\r"; break; // Unix default: return "\n"; } } (@__DIR__ == '__DIR__') && define('__DIR__', php_const_dir()); (@PHP_EOL == 'PHP_EOL') && define('PHP_EOL', php_const_eol()); var_dump(__DIR__); var_dump(PHP_EOL);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OpUTu
function name:  (null)
number of ops:  14
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                                                 
   24     3        BEGIN_SILENCE                                    ~1      
          4        END_SILENCE                                              ~1
   25     5        BEGIN_SILENCE                                    ~2      
          6        END_SILENCE                                              ~2
   27     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAL                                                 '%2Fin'
          9        DO_ICALL                                                 
   28    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAL                                                 '%0A'
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function php_const_dir:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 3
Branch analysis from position: 1
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 28
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 28
Branch analysis from position: 17
Branch analysis from position: 28
filename:       /in/OpUTu
function name:  php_const_dir
number of ops:  35
compiled vars:  !0 = $posix, !1 = $path
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > JMPZ                                                     <true>, ->3
          1    >   QM_ASSIGN                                        ~2      <true>
          2      > JMP                                                      ->4
          3    >   QM_ASSIGN                                        ~2      <false>
          4    >   ASSIGN                                                   !0, ~2
    6     5        INIT_FCALL                                               'substr'
          6        SEND_VAL                                                 '%2Fin%2FOpUTu'
          7        SEND_VAL                                                 0
          8        INIT_FCALL                                               'strrpos'
          9        SEND_VAL                                                 '%2Fin%2FOpUTu'
         10        SEND_VAL                                                 '%2F'
         11        DO_ICALL                                         $4      
         12        SEND_VAR                                                 $4
         13        DO_ICALL                                         $5      
         14        ASSIGN                                                   !1, $5
    8    15        BOOL_NOT                                         ~7      !0
         16      > JMPZ                                                     ~7, ->28
         17    >   INIT_FCALL                                               'str_replace'
         18        SEND_VAL                                                 '%5C'
         19        SEND_VAL                                                 '%2F'
         20        INIT_FCALL                                               'rtrim'
         21        SEND_VAR                                                 !1
         22        SEND_VAL                                                 '%2F%5C'
         23        DO_ICALL                                         $8      
         24        SEND_VAR                                                 $8
         25        DO_ICALL                                         $9      
         26        QM_ASSIGN                                        ~10     $9
         27      > JMP                                                      ->33
         28    >   INIT_FCALL                                               'rtrim'
         29        SEND_VAR                                                 !1
         30        SEND_VAL                                                 '%2F'
         31        DO_ICALL                                         $11     
         32        QM_ASSIGN                                        ~10     $11
         33    > > RETURN                                                   ~10
    9    34*     > RETURN                                                   null

End of function php_const_dir

Function php_const_eol:
Finding entry points
Branch analysis from position: 0
4 jumps found. (Code = 188) Position 1 = 14, Position 2 = 17, Position 3 = 20, Position 4 = 9
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 17
Branch analysis from position: 14
filename:       /in/OpUTu
function name:  php_const_eol
number of ops:  24
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'strtoupper'
          1        INIT_FCALL                                               'substr'
          2        SEND_VAL                                                 'Linux'
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 3
          5        DO_ICALL                                         $0      
          6        SEND_VAR                                                 $0
          7        DO_ICALL                                         $1      
          8      > SWITCH_STRING                                            $1, [ 'WIN':->14, 'DAR':->17, ], ->20
   13     9    >   CASE                                                     $1, 'WIN'
         10      > JMPNZ                                                    ~2, ->14
   16    11    >   CASE                                                     $1, 'DAR'
         12      > JMPNZ                                                    ~2, ->17
         13    > > JMP                                                      ->20
   14    14    >   FREE                                                     $1
         15      > RETURN                                                   '%0D%0A'
         16*       JMP                                                      ->22
   17    17    >   FREE                                                     $1
         18      > RETURN                                                   '%0D'
         19*       JMP                                                      ->22
   20    20    >   FREE                                                     $1
         21      > RETURN                                                   '%0A'
         22*       FREE                                                     $1
   22    23*     > RETURN                                                   null

End of function php_const_eol

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.72 ms | 1404 KiB | 27 Q