3v4l.org

run code in 300+ PHP versions simultaneously
<?php include('/tmp/test.txt'); $myfile = fopen("/tmp/test.txt", "w") or die("Unable to open file!"); $txt = "John Doe\n"; fwrite($myfile, $txt); $txt = "Jane Doe\n"; fwrite($myfile, $txt); fclose($myfile); // current directory echo getcwd() . "\n"; chdir('/tmp'); // current directory echo getcwd() . "\n"; $dir = '/var/www/html'; $files1 = scandir($dir); $files2 = scandir($dir, 1); print_r($files1); print_r($files2);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VSM7e
function name:  (null)
number of ops:  50
compiled vars:  !0 = $myfile, !1 = $txt, !2 = $dir, !3 = $files1, !4 = $files2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INCLUDE_OR_EVAL                                          '%2Ftmp%2Ftest.txt', INCLUDE
    3     1        INIT_FCALL                                               'fopen'
          2        SEND_VAL                                                 '%2Ftmp%2Ftest.txt'
          3        SEND_VAL                                                 'w'
          4        DO_ICALL                                         $6      
          5        ASSIGN                                           ~7      !0, $6
          6      > JMPNZ_EX                                         ~7      ~7, ->9
          7    > > EXIT                                                     'Unable+to+open+file%21'
          8*       BOOL                                             ~7      <true>
    4     9    >   ASSIGN                                                   !1, 'John+Doe%0A'
    5    10        INIT_FCALL                                               'fwrite'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
    6    14        ASSIGN                                                   !1, 'Jane+Doe%0A'
    7    15        INIT_FCALL                                               'fwrite'
         16        SEND_VAR                                                 !0
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
    8    19        INIT_FCALL                                               'fclose'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                                 
   11    22        INIT_FCALL                                               'getcwd'
         23        DO_ICALL                                         $13     
         24        CONCAT                                           ~14     $13, '%0A'
         25        ECHO                                                     ~14
   13    26        INIT_FCALL                                               'chdir'
         27        SEND_VAL                                                 '%2Ftmp'
         28        DO_ICALL                                                 
   16    29        INIT_FCALL                                               'getcwd'
         30        DO_ICALL                                         $16     
         31        CONCAT                                           ~17     $16, '%0A'
         32        ECHO                                                     ~17
   18    33        ASSIGN                                                   !2, '%2Fvar%2Fwww%2Fhtml'
   19    34        INIT_FCALL                                               'scandir'
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                         $19     
         37        ASSIGN                                                   !3, $19
   20    38        INIT_FCALL                                               'scandir'
         39        SEND_VAR                                                 !2
         40        SEND_VAL                                                 1
         41        DO_ICALL                                         $21     
         42        ASSIGN                                                   !4, $21
   22    43        INIT_FCALL                                               'print_r'
         44        SEND_VAR                                                 !3
         45        DO_ICALL                                                 
   23    46        INIT_FCALL                                               'print_r'
         47        SEND_VAR                                                 !4
         48        DO_ICALL                                                 
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.79 ms | 1392 KiB | 27 Q