6

I just downloaded xampp(7.0.8) from xampp download page and installed with no error but when I create a new project in Netbeans it shows only 5.4 as the highest php version whereas what I have is php7. I tried with xampp 5.6.23 and still Netbeans did not show php5.6.

What's happening? How can I make Netbeans show php7 or php5.6 . I have xampp for both versions.

Charlie Brumbaugh
  • 219
  • 1
  • 5
  • 15
Saurab
  • 1,931
  • 5
  • 20
  • 33
  • Little late to the party but to add clarification. It does not matter for the project that you are creating if your server is capable of run php 7 or not. You inidicate a version in which you will be working, as the other versions of netbeans do not have support for php 7, it is not an elegible linter option. – ecarrizo Oct 06 '17 at 03:27

4 Answers4

11

Netbeans 8.2 Will support PHP7 (http://wiki.netbeans.org/NetBeans_82)

You can download nightly builds version 8.2 http://bits.netbeans.org/dev/nightly/latest/

Ram
  • 506
  • 2
  • 5
  • 15
  • while I UPVOTED and accepted this answer, as I downloaded and it worked, I genuinely request to please answer my question. It's NOT the answer I have been looking for. – Saurab Aug 09 '16 at 17:39
  • 4
    Why did you upvote and accept this answer if it did not answer your question ? – Maxime Jun 01 '18 at 14:42
  • 2
    That's nice that it says it will support it. However when put into practice it does not even give the option to use PHP 7+ in the options of creating a PHP project. – Tyler Lazenby Jan 21 '19 at 21:51
7

When creating a project in Netbeans, make sure to select the right PHP version on step 2 in the wizard. I know this question is a old one, but I came here since my older project was created on 5.6. To change a current project, open your project properties and on the Sources categorie change the PHP Version to the version you want to use.

To make clear. It does not matter at all what XAMPP you install. This setting is used for the hints in the editor. The final location of your project where it runs in the webserver has nothing to do with Netbeans at all.

E. Peter
  • 127
  • 2
  • 6
0

Unfortunately the Netbeans still doesn't support some PHP7 syntax features like the typed properties. E.g.

   Class Foo { public int $bar }

shows a syntax error hint because of the "INT" attribute of $bar property despite that is allowed by PHP7

Other e.g.

public function foo(?int $bar){}

also shows syntax error due to the question mark.

I wish they will publish an update or even a pack.

Mahmut Gulerce
  • 111
  • 1
  • 3
-5

Use Sublime Text instead of Netbeans, I mean if you just want to use netbeans to work with PHP, Sublime Text is better, just a suggestion.

Professor Zoom
  • 339
  • 1
  • 4
  • 13
  • 3
    but sublime text doesnot have click and goto functions or class feature nad many more that netbeans provide. I just want to know if I can make my current netbeans show php7 or I have to download netbeans 8.1 – Saurab Aug 09 '16 at 17:08
  • Well, I dont use netbeans but you could check in the official website if your version works well with PHP7, I dont think is an error, maybe netbeans just has help only to that version of PHP 5.4 but of course you can work with any version just is it will not provide you help in some cases, talking about syntax and autocomplete functions of PHP, check @Nantha answer – Professor Zoom Aug 09 '16 at 17:11
  • @Proffessor well I always use netbeans and this is the first time I have encountered such problem while installing it. So asuming, some people might have encountered such problem,I am asking this question – Saurab Aug 09 '16 at 17:19
  • I know, I just was trying to help you, but I think @Nantha answer could help you – Professor Zoom Aug 09 '16 at 17:21
  • I know you were trying to help me , thanks. Well I am installing netbeans 8.2, even though it was not the solution I was looking for, let's see if it solves my problem – Saurab Aug 09 '16 at 17:23