From 67f0e5654320bec543b93fcefd63250957274a8c Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Tue, 5 Dec 2017 09:19:00 +0100 Subject: [PATCH] Fix examples/ping-many.php to run correctly on Windows --- examples/ping-many.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/ping-many.php b/examples/ping-many.php index 2541c6d..b398311 100644 --- a/examples/ping-many.php +++ b/examples/ping-many.php @@ -24,7 +24,10 @@ Amp\Loop::run(function () { $promises = []; foreach ($hosts as $host) { - $process = new Process("ping -c 5 {$host}"); + $command = \DIRECTORY_SEPARATOR === "\\" + ? "ping -n 5 {$host}" + : "ping -c 5 {$host}" + $process = new Process($command); $process->start(); $promises[] = new Amp\Coroutine(show_process_output($process)); }