PHP Tips, Resources and Best Practices for 2015

I totally agree with your comments on PHP versions. Projects should not support PHP versions that are no longer officially supported by PHP. It dissuades people from upgrading and as you say, damages the entire ecosystem.

Once official PHP support for a version is dropped, so should project support.

I think that minor versions of projects (or major versions of software with rapid dev cycles) should start with a minimum of whatever PHP version is oldest current and stay with that for its life cycle. Hence if Drupal 8 where to go gold today it would support PHP 5.5 until 8.1 is released.

I think thereā€™s equal chance of people having 5.5 and 5.6 installed - both suffer from a lack of exposure. Iā€™d go with 5.6 off the bat.

5.5 is still better than the 5.2 floor more than a few projects are holding onto (Wordpressā€¦)

very usefull, thanks for the informations here

The current version of WordPress may still run on 5.2 but it is intended to be run on 5.5.

On 5.5 it uses the mysqli database interface instead of the mysql one - as you can easily find out by turning the mysql interface off.

Unfortunately many WP installations is on shared hosting where they are probably affraid of upgrading.

Its crazy that only 10% of all WP installations is 4.1 and 32% of all installations is running on PHP5.2

Not everyonly is updating like the rest of us:)

It is all of the other sites sharing on the same server who need to be afraid of those not upgrading as not upgrading produces a potential security hole on the server.

No wonder WordPress has such a bad reputation if 90% of installs are not up to date.

I used to work at a web agency who didā€™nt care about upgrading unless the customer directly paid for the upgrade. So instead we used alot of time to fixed those sites which got hacked WITHOUT the customer paying.

I hope thats not the attitude elsewhere.

Hi,

very usefull Thanks for the share

information that you share exactly, it makes sense, and Iā€™ve used it successfully, thank you for sharing

Amen!

It doesnā€™t matter what developer you are, this is a general ā€œdeveloper commandmentā€ I believe in.

A lot of times too, especially helping on the Internet, you might try and help someone, only to learn, you arenā€™t quite right yourself. So you also end up learning too. I think, as a developer, being humble in knowing that I donā€™t know everything, is also important. It is actually another commandment.

ā€œThou shall always be humble and never think thy knowledge is all encompassing!ā€

The other commandment from Bruno could be

ā€œThou shall always help the lesser knowing developerā€.

:innocent:

Scott

3 Likes

cool thank you!

It sounds very interesting!
i like the post very much keep it up
Yah this forum is making a dfference. I love it.

1 Like

You can not directly criticize PHP. PHP is an open source language and you can learn form the internet, there are thousand of tutorials are available. You can make PHP secure by powerful scripting.

Very useful site, thanks everyone, glad to be a member

Good article with link to read and learn more on PHP. I started with w3school and it serves to be the simple and easy PHP guide.

PHP is a very popular language, because it appears to be simple to learn. There is a lot of tutorials out there, but (as already said) most of them are outdated or lack security considerations.

I think, the major problem is not the core. The main problem are the old versions on small servers running, because the admins are big hosting companies and they do not want to explain to the user why a specific script can not run.

A lot of PHP programmers do a lot of coding in their free time and security has always been a pain in the a**. You can break things really fast, if you donā€™t know what you do in the update process.

PHP (like other server technology) is open to attacks from all over the world, this fact must be emphasized on the main PHP help pages.

To fix this, we have to:

  • provide best practices for novices (escape input / output, check input boundaries etc.)
  • provide anti-patterns
  • encourage big frameworks to move to newer PHP versions and drop old version support

Thanks for giving me this guide, this could help me from my future PHP programming :smile:

Well I have also started learning php during these week and I must say Iā€™ve been really enjoying learning it.

My favorite place for php discussion is pingx.net