PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?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' . microtime() - $m;
Show:  
Copy Clear