3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(100); //include('/etc/profile'); $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); echo system("echo 'test' > /tmp/hacked.txt"); $dir = '/tmp/'; $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 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F65O5
function name:  (null)
number of ops:  45
compiled vars:  !0 = $myfile, !1 = $txt, !2 = $dir, !3 = $files1, !4 = $files2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 100
          2        DO_ICALL                                                 
    4     3        INIT_FCALL                                               'fopen'
          4        SEND_VAL                                                 '%2Ftmp%2Ftest.txt'
          5        SEND_VAL                                                 'w'
          6        DO_ICALL                                         $6      
          7        ASSIGN                                           ~7      !0, $6
          8      > JMPNZ_EX                                         ~7      ~7, ->11
          9    > > EXIT                                                     'Unable+to+open+file%21'
         10*       BOOL                                             ~7      <true>
    5    11    >   ASSIGN                                                   !1, 'John+Doe%0A'
    6    12        INIT_FCALL                                               'fwrite'
         13        SEND_VAR                                                 !0
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
    7    16        ASSIGN                                                   !1, 'Jane+Doe%0A'
    8    17        INIT_FCALL                                               'fwrite'
         18        SEND_VAR                                                 !0
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
    9    21        INIT_FCALL                                               'fclose'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
   11    24        INIT_FCALL                                               'system'
         25        SEND_VAL                                                 'echo+%27test%27+%3E+%2Ftmp%2Fhacked.txt'
         26        DO_ICALL                                         $13     
         27        ECHO                                                     $13
   13    28        ASSIGN                                                   !2, '%2Ftmp%2F'
   14    29        INIT_FCALL                                               'scandir'
         30        SEND_VAR                                                 !2
         31        DO_ICALL                                         $15     
         32        ASSIGN                                                   !3, $15
   15    33        INIT_FCALL                                               'scandir'
         34        SEND_VAR                                                 !2
         35        SEND_VAL                                                 1
         36        DO_ICALL                                         $17     
         37        ASSIGN                                                   !4, $17
   17    38        INIT_FCALL                                               'print_r'
         39        SEND_VAR                                                 !3
         40        DO_ICALL                                                 
   18    41        INIT_FCALL                                               'print_r'
         42        SEND_VAR                                                 !4
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.45 ms | 1400 KiB | 27 Q