Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $descriptors = array(
- 0 => array("pipe", "r"),
- 1 => array("pipe", "w")
- );
- $php = proc_open('php', $descriptors, $pipes);
- stream_set_blocking($pipes[1], 0);
- fwrite($pipes[0], '<?php echo \'foo\'; fopen(\'php://stdout\', \'w\'); echo \'bar\'; ?>');
- fclose($pipes[0]);
- $null = null;
- $select = array($pipes[1]);
- while (feof($pipes[1]) === false)
- {
- if (stream_select($select, $null, $null, null))
- {
- var_dump(stream_get_contents($pipes[1]));
- }
- }
Add Comment
Please, Sign In to add comment