https://www.ebavs.net/wp-content/uploads/2016/09/ebavs-function-datastore.png 298 995 victor https://www.ebavs.net/wp-content/uploads/2021/06/logo-ebavs.png victor2015-03-27 14:24:222021-09-02 09:05:44Best practices in modern PHP (> 5.4) development
I recently spoke with a personal fan of PHP development. He had developed a page with Bootstrap and PHP, and things of life, we found a huge bug in the registration and user login. After talking a while with this person I realize that the guidelines or implementing rules were was still PHP 5.1 or PHP 5.2 (today we use PHP 5.6). Use functions mysql_ for the connection and query to the database, the PHP pages use pattern spaghetti (Spaghetti Code, POO absent, etc …
Worst of all, in the last year, I have seen a lot of this type of code. So we are working to changing this. One of the problems is how difficult it is nowadays to find reliable articles on Google. If we search something as normal as PHP database connect appears results like these: Check the first three results, they are obsolete PHP documentation. In PHP 5.5 marked as deprecated the mysql_ functions and PHP 5.6 does not work.
The fourth result is a post that explains how to create a database connection (what we wanted!) but… in 2006. 9 years ago! When people – who want to start in the development’s world – find these results and followed them, please do not follow, unfollow them. I recommend the following guidelines, updated in 2015 that explain the current way of developing in PHP.
PHP The Right Way
PHP Best Practices
These guidelines will help you have a more solid foundation in development with PHP.