This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 144431

Summary: [65cat] [php] String Break
Product: php Reporter: nvarun <nvarun>
Component: CodeAssignee: Petr Pisl <ppisl>
Status: NEW ---    
Severity: blocker CC: pjiricka, tmysik
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: ENHANCEMENT Exception Reporter:

Description nvarun 2008-08-19 18:51:16 UTC
[ BUILD # : 6.5 Beta ]
[ JDK VERSION : 1.6.0_05 ]

Suppose I have to "echo" a string like this

echo "Hello World";

For instance, if the cursor position is just right to the letter 'o'
in Hello like this;
echo "Hello$cursor World"

where $cursor is actually the position of cursor, not the word
$cursor. If you remember in Java, when you hit enter in such
scenario. String breaks into 2 strings with a plus sign in between
like this-

"Hello" +
" World"

I thought PHP support might have similar functionality, though
instead of  '+' sign, we have '.' sign, right?

"Hello".
" World"

I queried php mailing list for nbusers and found out that its
inconsistence, and might be a bug!

So, I am filing this issue..
Comment 1 nvarun 2008-08-19 18:52:38 UTC
Changed the summary a bit to follow NetCAT etiquette.
Comment 2 Tomasz Slota 2008-08-19 20:49:27 UTC
confirmed
Comment 3 Tomasz Slota 2008-08-20 09:54:44 UTC
In PHP it is possible to have strings spanning across multiple lines. It is a common practice with SQL statements e.g.

sprintf('

SELECT * FROM `table`

WHERE

`id` = %d

`this` = \'that\'

', $id);

So the break string functionality would be counterproductive for many users. We could still provide it as an option. I am changing the issue type to 
"enhancement"

(based on feedback from Jacob Christophersen)
Comment 4 Petr Pisl 2008-08-29 08:30:01 UTC
We discussed this on the mailing list. Because this is a way how to write correct code in PHP.

The enhancement is that there can be an option in the PHP editor setting, which will direct the behavior. The default
one should be the current one.