From e28a4a9cec370f30dd22e850b7c36d380f1907c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20St=C3=BCmmel?= <7893682+janstuemmel@users.noreply.github.com> Date: Tue, 21 Jan 2020 18:57:12 +0100 Subject: [PATCH] Fix php cheatsheet, for loop iterates over all values, not just n-1 values --- languages/php.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/languages/php.php b/languages/php.php index 572cf93..beb1291 100644 --- a/languages/php.php +++ b/languages/php.php @@ -24,7 +24,7 @@ foreach($arr as $key => $value) { } // For -for($i = 0; $i < count($arr) - 1; $i++) { +for($i = 0; $i < count($arr); $i++) { $key = $i; $value = $arr[$i]; } @@ -338,4 +338,4 @@ class ClassWithLogger * Use the LoggerAwareTrait in this class. */ use LoggerAwareTrait; -} \ No newline at end of file +}