Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', 'stderr');
- ini_set('log_errors', 'Off');
- ini_set('log_errors_max_len', '0');
- $php = proc_open(
- escapeshellarg('C:\Program Files\Zend\ZendServer\bin\php.exe'),
- array(
- 0 => array('pipe', 'r'),
- 1 => array('pipe', 'w'),
- 2 => array('pipe', 'w')
- ),
- $phpPipes
- );
- fwrite($phpPipes[0], '<?php echo uniqid(); ?>');
- fclose($phpPipes[0]);
- unset($phpPipes[0]);
- $null = null;
- $pipes = $phpPipes;
- $pipesUpdated = stream_select($pipes, $null, $null, sizeof($phpPipes) ? 0 : null);
- while ($pipesUpdated !== false && $pipesUpdated > 0)
- {
- foreach ($pipes as $pipe)
- {
- if (isset($phpPipes[1]) && $pipe == $phpPipes[1])
- {
- $start = microtime(true);
- echo stream_get_contents($pipe) . "\n";
- var_dump(microtime(true) - $start);
- if (feof($pipe) === true)
- {
- fclose($pipe);
- unset($phpPipes[1]);
- }
- }
- else
- {
- $start = microtime(true);
- echo stream_get_contents($pipe) . "\n";
- var_dump(microtime(true) - $start);
- if (feof($pipe) === true)
- {
- fclose($pipe);
- unset($phpPipes[2]);
- }
- }
- }
- $pipes = $phpPipes;
- $pipesUpdated = sizeof($pipes) <= 0 ? false : stream_select($pipes, $null, $null, sizeof($phpPipes) ? 0 : null);
- }
- echo 'Done' . "\n";
Add Comment
Please, Sign In to add comment