3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "before\n"; var_dump(realpath(__DIR__.'/..')); var_dump(realpath('./')); chdir('/tmp'); echo "after\n"; var_dump(realpath(__DIR__.'/..')); var_dump(realpath('./'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FsJJ2
function name:  (null)
number of ops:  30
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ECHO                                                     'before%0A'
    3     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'realpath'
          3        SEND_VAL                                                 '%2Fin%2F..'
          4        DO_ICALL                                         $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
    4     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'realpath'
          9        SEND_VAL                                                 '.%2F'
         10        DO_ICALL                                         $2      
         11        SEND_VAR                                                 $2
         12        DO_ICALL                                                 
    6    13        INIT_FCALL                                               'chdir'
         14        SEND_VAL                                                 '%2Ftmp'
         15        DO_ICALL                                                 
    8    16        ECHO                                                     'after%0A'
    9    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'realpath'
         19        SEND_VAL                                                 '%2Fin%2F..'
         20        DO_ICALL                                         $5      
         21        SEND_VAR                                                 $5
         22        DO_ICALL                                                 
   10    23        INIT_FCALL                                               'var_dump'
         24        INIT_FCALL                                               'realpath'
         25        SEND_VAL                                                 '.%2F'
         26        DO_ICALL                                         $7      
         27        SEND_VAR                                                 $7
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.8 ms | 1395 KiB | 19 Q