Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$m = microtime();
$a = 1;
$b = -5;
$c = 0;
$positive_count = 0;
$negative_count = 0;
foreach([$a, $b, $c] as $n) {
if ($n > 0) $positive_count++;
if ($n < 0) $negative_count++;
}
printf("В данном наборе положительных чисел %s, отрицательных чисел %s", $positive_count, $negative_count);
echo PHP_EOL . 'm' . $m - microtime();