Guest User

Untitled

a guest
Feb 19th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. <?php
  2.  
  3. $descriptors = array(
  4.    0 => array("pipe", "r"),
  5.    1 => array("pipe", "w")
  6. );
  7.  
  8. $php = proc_open('php', $descriptors, $pipes);
  9.  
  10. stream_set_blocking($pipes[1], 0);
  11.  
  12. fwrite($pipes[0], '<?php echo \'foo\'; fopen(\'php://stdout\', \'w\'); echo \'bar\'; ?>');
  13. fclose($pipes[0]);
  14.  
  15. $null = null;
  16.  
  17. $select = array($pipes[1]);
  18.  
  19. while (feof($pipes[1]) === false)
  20. {
  21.     if (stream_select($select, $null, $null, null))
  22.     {
  23.         var_dump(stream_get_contents($pipes[1]));
  24.     }
  25. }
Add Comment
Please, Sign In to add comment