Home Download Buy Blog Forum Support

Bug in "Expand selection to scope" in PHP

Bug in "Expand selection to scope" in PHP

Postby hibbelig on Mon Dec 26, 2011 10:51 pm

Consider the following bit of C code:
Code: Select all
#include <stdio.h>
int main(int argc, char** argv)
{
   if (1 == 1) {
      printf("yes\n");
   } else {
      printf("no\n");
   }
}

Put point on the "printf" in the else branch of the conditional. Do "Expand selection to scope". It highlights the printf. Again. It highlights the else part of the conditional. Again. It highlights the body of the function. Good.

Now consider the following bit of PHP code:
Code: Select all
<?php

function foo()
{
   if (1 == 1) {
      echo("yes\n");
   } else {
      echo("no\n");
   }
}

Put point on the "echo" in the else branch. Do "Expand selection to scope". It highlights the "echo". Good. Again. It highlights from start of file to the end of the string "no\n"!?!? Very weird.

If I do the same thing in the "if" leg, then it highlights from the start of the file until the end of the string "yes\n", which was half-expected.

Using build 2139.
hibbelig
 
Posts: 77
Joined: Wed Dec 21, 2011 11:24 pm

Re: Bug in "Expand selection to scope" in PHP

Postby hibbelig on Mon Dec 26, 2011 11:05 pm

I tried build 2152 which exhibits the same misbehavior.
hibbelig
 
Posts: 77
Joined: Wed Dec 21, 2011 11:24 pm


Return to Technical Support

Who is online

Users browsing this forum: valerij_ and 16 guests