Got a new one for you 😅

Fails:

<?php
function foo() {
  $options = ['hi'];
  ?>
  <div>
    <div>
      <select>
        <option>Nothing</option>
        <?php foreach ($options as $option): ?>
      <option>
            <?= $option ?>
      </option>
        <?php endforeach; ?>
    </select>
  </div>
</div>
  <?php
}

Works:

<?php
function foo() {
  $options = ['hi'];
  ?>
  <div>
    <select>
      <option>Nothing</option>
      <?php foreach ($options as $option): ?>
        <option>
          <?= $option ?>
        </option>
      <?php endforeach; ?>
    </select>
  </div>
  <?php
}

(removed one level of divs)

This one seems to have been introduced somewhat recently - code that was formatted before is getting mangled as I save it now. I'm on the pre-release branch in VSCode.

    And one other (I was waiting for more than one)

    Array arrow-alignment doesn't (no longer?) works with class constant keys:

    <?php
    class Mock {
      const one = 1;
      const twotwo = 2;
    }
    
    $a = [
      'one'    => 1,
      'twotwo' => 2,
    ];
    
    $b = [
      Mock::one => 1,
      Mock::twotwo => 2,
    ];

    Having trouble finding the example, but it gets extra wonky with mixed string and constant keys. Sometimes works, sometimes doesn't.

      Hi Kris,

      Thank you for the report.

      The first one looks like something we've messed up in the pre-release version. It will be fixed!

      It looks like the second one was there all along, will be fixed as well.

      Thank you!

        Hi Kris,

        This is solved and it will be available in the next pre-release.

        Thank you!

        Write a Reply...