Homec4science

Pass an integer to stream_select() for correctness

Authored by epriestley <git@epriestley.com> on Mar 19 2014, 18:22.

Description

Pass an integer to stream_select() for correctness

Summary: Ref T4627. Passing $timeout_sec is slightly more correct here, although there is no change to program behavior.

Test Plan:
Used this script to verify that passing 0 and 0.999321 (for example) have the same effect to stream_select():

<?php

$spec = array(
  0 => array('pipe', 'r'),
  1 => array('pipe', 'w'),
  2 => array('pipe', 'w'),
);

$pipes = array();
$proc = proc_open('sleep 30', $spec, $pipes);
list($stdin, $stdout, $stderr) = $pipes;

$read = array($stdout, $stderr);
$write = array();
$except = array();

$select_start = microtime(true);
stream_select($read, $write, $except, 0.999321, 80000);
$select_end = microtime(true);

printf(
  "select() took %d us to return.\n",
  ($select_end - $select_start) * 1000000);

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4627

Differential Revision: https://secure.phabricator.com/D8567

Details

Committed
epriestley <git@epriestley.com>Mar 19 2014, 18:22
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUf3eca1026279: Allow multiple LDAP search filters, and complex search queries
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUa5fd944af95d: Pass an integer to stream_select() for correctness (authored by epriestley <git@epriestley.com>).Mar 19 2014, 18:22