NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
IS Nucoder really supporting PHP 5.3?


Joined: 12 Jun 2014
Posts: 6
Location: France
Reply with quote
Hi,
I currently got the 3.0.2 build 2045 version.
I see from my tests that nucoder does not support all of the 5.3 features.

Before paying the $100 nucoder upgrade (for last version) for a probable discontinued product, I would like to know if it will actually support full 5.3 features?

Particularily:
- Late Static Binding
- Closures

here are 2 sample that will fail with nucoder:

--> Notice the "static::"
Code:

 class Automobile {
  static $horn = "beep";
  static function honkHorn() {
//    echo self::$horn;
//PHP 5.3's new late-static binding feature: use the static keyword to reference the class attribute that will be displayed rather than the self keyword:
    echo static::$horn;
  }
}

class GeneralLee extends Automobile {
  static $horn = "HONKITY HONK HONKY TONK!!!";
}


//What do you believe will happen when the following command is called?
GeneralLee::honkHorn();



closures (or anonymous functions if you prefer):

Code:

$history = 'The Magna Carta was signed on 06-15-1215.';

echo preg_replace_callback("|(d{2})-(d{2})-(d{2})|",
                           function($matches) {   
                             return "{$matches[2]}-{$matches[1]}-{$matches[3]}";
                           },
                           $history
     );


Currently Nucoder do not recognize the statements ("parse error, unexepected _STATIC")

I am ok to stick to php 5.3 because most of the features of 5.4 got me thinking "Hey, I don't need that"
(except for simplified array declarations)

But a decent support of the 5.3 langage version would be necessary.

Thanks for your answer
View user's profileFind all posts by inducidoSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7823
Reply with quote
Of course NuCoder is compatible with all php 5.3 features, including static and closures.
Looks like you did not specify -c 5.3 command line argument or didn't select PHP 5.3 or higher in the GUI settings. In this case, nucoder runs pre-5.3 builtin php parser to make sure that your script will run under previous versions of php (5.2 by default). Since your code is not pre-5.3 compatible, you must user -c 5.3 Smile. I hope it's clear.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 12 Jun 2014
Posts: 6
Location: France
Reply with quote
Hi,
well, RTFM Embarassed

I am glab I was wrong and to continue relying on nu-coder.
PHP 5.3 is all I need for my projects.

Thanks
View user's profileFind all posts by inducidoSend private message
IS Nucoder really supporting PHP 5.3?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic