3v4l.org

run code in 300+ PHP versions simultaneously
<?php file_put_contents("/tmp/foo","bar"); $bar = file_get_contents("/tmp/foo"); echo $bar."<-------------"; function syscall($command){ $result = ""; if ($proc = popen("($command)2>&1","r")){ while (!feof($proc)) $result .= fgets($proc, 1000); pclose($proc); return $result; } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cS5Ls
function name:  (null)
number of ops:  11
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'file_put_contents'
          1        SEND_VAL                                                 '%2Ftmp%2Ffoo'
          2        SEND_VAL                                                 'bar'
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'file_get_contents'
          5        SEND_VAL                                                 '%2Ftmp%2Ffoo'
          6        DO_ICALL                                         $2      
          7        ASSIGN                                                   !0, $2
    7     8        CONCAT                                           ~4      !0, '%3C-------------'
          9        ECHO                                                     ~4
   17    10      > RETURN                                                   1

Function syscall:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 26
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 12
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 12
Branch analysis from position: 22
Branch analysis from position: 12
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cS5Ls
function name:  syscall
number of ops:  27
compiled vars:  !0 = $command, !1 = $result, !2 = $proc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        ASSIGN                                                   !1, ''
   11     2        INIT_FCALL                                               'popen'
          3        ROPE_INIT                                     3  ~5      '%28'
          4        ROPE_ADD                                      1  ~5      ~5, !0
          5        ROPE_END                                      2  ~4      ~5, '%292%3E%261'
          6        SEND_VAL                                                 ~4
          7        SEND_VAL                                                 'r'
          8        DO_ICALL                                         $7      
          9        ASSIGN                                           ~8      !2, $7
         10      > JMPZ                                                     ~8, ->26
   12    11    > > JMP                                                      ->17
         12    >   INIT_FCALL                                               'fgets'
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 1000
         15        DO_ICALL                                         $9      
         16        ASSIGN_OP                                     8          !1, $9
         17    >   INIT_FCALL                                               'feof'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $11     
         20        BOOL_NOT                                         ~12     $11
         21      > JMPNZ                                                    ~12, ->12
   13    22    >   INIT_FCALL                                               'pclose'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
   14    25      > RETURN                                                   !1
   16    26    > > RETURN                                                   null

End of function syscall

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.65 ms | 1400 KiB | 25 Q