3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo syscall("/bin/bash ls -lathr"); 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/BtaZ3
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'syscall'
          1        SEND_VAL_EX                                              '%2Fbin%2Fbash+ls+-lathr'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   13     4      > 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/BtaZ3
function name:  syscall
number of ops:  27
compiled vars:  !0 = $command, !1 = $result, !2 = $proc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN                                                   !1, ''
    7     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
    8    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
    9    22    >   INIT_FCALL                                               'pclose'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
   10    25      > RETURN                                                   !1
   12    26    > > RETURN                                                   null

End of function syscall

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.92 ms | 1396 KiB | 21 Q