Clarification on SC9 and PHP 7/5.6 for the IDE and deployed apps

Hi everyone,
I think I asked this in another thread a while back, but now that there are more people who have tried SC9, maybe you can clarify:

Q1 – Can I install SC9 (the development IDE) into a PHP5.6 environment, or does SC9 have to run only in PHP7?

Q2 – I understand that SC9 can generate applications that can run in either PHP5.6 or PHP7, but is there a option or something that let’s us choose the target PHP for deployment? Or is this generating multiple code and chooses in run-time?

Q3 – If it makes code that can run on both versions of PHP, is there a programming guide (or PHP target setting/switch ) for us to follow when making custom event code? In other words, can we have an event for 5.6 and 7, with the appropriate code getting generated for that deployment? I run certain systems on multiple servers and multiple hosts, each with specific environment settings, and they are not all 100% on board with PHP7 yet. Stability is more important than ‘cutting edge’ for some applications.

Those 3 questions are on my mind as I contemplate how to best move forward into SC9 at some future date… after the storm clouds clear up some.:rolleyes:
Peace,
Jamie

Hi Jamie,

  1. SC 9 requires PHP 7, in fact it will install it automatically if you use windows. (Don’t know of other configs)
  2. Afaik there is no such option. SC generates PHP 5.6/7 compatible code
  3. From the docs; Production environment for generated applications approved for PHP 5.6 and 7.

What you need to keep in mind is applying your own code. If you use PHP7 constructs in your events then you cannot expect that the generated application will run on PHP 5.6. So you have to be aware of PHP 7 compatiblities. But I’m sure you know that.

cheers, ALbert

Thanks Albert,
That clarifies it nicely.

So I guess, logically, that the PHP 5.6 parser will not throw syntax errors if it encounters PHP 7 commands? I have not tried that yet.

I guess that SC must make if/then decisions on what code to execute depending on what the PHP version it is deployed on? Seems like the code could be getting even larger and more complex? I wonder if that is causing some of the many bugs going on?

I would feel better if there was a setting in the SC 9 IDE for the deployment target. That way they could send only the specific files… maybe I am making too much of this?

I see there are some open source scanners that will document PHP code, like https://github.com/sstalle/php7cc . I have some large custom code pieces that run in event and in blanks. I shudder to think what such a scan would show on SC generated code???

I am also interested to see any benchmark testing with SC generated code. Does SC exploit speed enhancements or does it fall into traps doing things badly, to retain compatibility?
That would help answer how worth it is short run is converting to PHP 7? Obviously in long run it is critical.

I am happy and excited to (someday) use SC9 and build for PHP7, since I read how much faster some PHP code will run. I do have a practical situation on one of my main systems. Since it is a HIPAA compliant system running on a super secured server, PHP is not available to me for the deployed application yet. Hopefully SC bug-stabilization and PHP 7 availability will converge at a convenient time LOL. My super low-cost host I have used for years has had PHP7 since it was released. I will have to take time soon to play and test. :wink:

Peace,
Jamie

I think that your code - as far it concerns the basic SC core - will run. As far as you have applied your own code in events or libraries, you need to find out what issues you might get. Regarding php 7, I haven’t run into much issues and the differences can be found on http://php.net/manual/en/migration70.incompatible.php. But as soon as you start using php 7 and it’s extensions you are limiting yourself to php 7. But that’s the horizon anyway…

How do you suggest to provide security patches regarding the used PHP version?
Is it safe to update PHP (security patches) manually if SC9 was installed manually or will it break my installation of SC?

Currently using PHP 7.0.19 on Ubuntu 16.04, but this question is for PHP 5.6 as well.

Regarding your production server there is no issue if you install patches and fixes. On your development system I’m not sure, but I expect that you could. Always safe to create a full binary backup before applying so you can revert if things go bad.