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 192458

Summary: Line breaks in PHP template
Product: php Reporter: kamazee
Component: EditorAssignee: Ondrej Brejla <obrejla>
Status: NEW ---    
Severity: normal CC: amobilia
Priority: P3    
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description kamazee 2010-11-25 10:53:52 UTC
2 line breaks are added after <?php when using a code template if <?php is placed into the first line.

How to reproduce:
1. Create new PHP code template
2. Put the following text in a new template (without apostrophes of course): '<?php echo "Is it a bug?";'
3. Use a new template: (Right click on context menu of any project's folder) » new » PHP » Just created template

The following apeears:
<?php 

echo "Is it a bug?";

instead of
<?php echo "Is it a bug?";

The bug appears only if <?php is at the first line and not closes with ?>
Comment 1 Ondrej Brejla 2011-10-03 13:54:58 UTC
It's because formatter rules are applied to that new file...you can remove blank line after <?php by "Tools->Options->Editor->Formatting->PHP->Blank Lines->After open tag" (set it to 0), but I think that there is no option for disabling "new line" after php open tag...
Comment 2 Ondrej Brejla 2012-09-12 09:36:43 UTC
Enhancement, since this option has never been implemented.
Comment 3 amobilia 2016-09-22 17:05:29 UTC
The option is present on 8.2rc / Dev 201609210002 

Formating -> PHP -> Blank lines -> After open tag
But if you set 0 instead of 1, nothing appears...

=> DEFECT