Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Conversation

@umlaeute
Copy link

@umlaeute umlaeute commented Feb 14, 2023

php is not Python, and the indentation is meaningless for code-blocks...

thus the snippet

if ($foo)
  foreach ($x as $a => $b)
    if ($yikes)
       doit;
elseif ($bar)
  somethingelse;

really does:

if ($foo) {
  foreach ($x as $a => $b) {
    if ($yikes) {
       doit;
    } elseif ($bar) {
       somethingelse;
    }
  }
}

whereas what we want is:

if ($foo) {
  foreach ($x as $a => $b) {
    if ($yikes) {
       doit;
    }
  }
} elseif ($bar) {
  somethingelse;
}

this was a regression introduced with ff31aff

Closes: #55

php is not Python, and the indentation is meaningless for code-blocks.

Closes: joshp23#55
@Lucas-C
Copy link

Lucas-C commented Dec 2, 2024

I have also been bitten by this

This is also a duplicate of #59

Please merge one of those PRs 🙏

@PlanetAngie
Copy link

Gosh, what an easy fix for such an annoying bug. Yes, please merge one of those.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Administrators" are not allowed to manage plugins...

3 participants