• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • PHP Is Here To Stay: PHP 8 And Beyond

    November 1, 2021 Mike Pavlak

    In 2005, PHP ushered in the era of TRUE open source development on IBM i with version 5.3 of the language, thanks to the dedicated efforts of Zend and IBM Rochester. PHP had just gone through a major evolution and was taking the world by storm in the middle of the Version 5 phenomena.

    Many IBM i developers were rapidly wrapping their heads around this wildly popular scripting technology with code stored in IFS files and Db2 data popping up on pages running directly on IBM i. Nearly every website on the web that was not HTML had some flavor of PHP and for good reason: it just works. Fast forward 15+ years and we see there are quite a few technologies vying for the attention of the development team and PHP is still doing the lion’s share of the heavy lifting. Let’s take a look at where PHP is today and where it looks to move in the near future.

    Today, PHP runs 78.9 percent of the visible web according to W3techs. If you extrapolate that out by the number of websites on the net at 1.8 billion according to Statista, that rounds out at over a billion sites running PHP. With all that volume, something must be going right. But you might be saying to yourself, I bet a bunch of those are using older versions of PHP. Not so fast . . . W3techs has the skinny on that number, too – showing about 70 percent of the PHP sites are at PHP 7 and 30 percent are still running the trusted PHP 5 variants. That can’t be good, can it? Well, the obvious answer is, it depends.

    IBM i has had a long-standing tradition of protecting a business’s investment in technology – meaning that very old versions of RPG can run on the newer hardware without issue. PHP, however, is not the same as RPG – but there are opportunities. Many folks are concerned because their network auditors have turned up an older version of PHP running within the environment. This is a good reminder to update to current PHP versions. There are several good reasons to do this that I will outline in the next few paragraphs, using the “carrot and stick” analogy to help amplify the urgency in each scenario.

    Security – Here’s The First Stick

    According to the folks at HelpSystems, security is the foremost concern of IBM i shops. There doesn’t seem to be a day that passes without some story of a company that was either hacked or bricked by ransomware. A survey by Statista identified that “68 percent of US organizations admitted to having experienced – and as a result paid the ransom for – ransomware attacks that year.” As a result, companies are really taking this quite seriously. PHP is a “perimeter” technology and as such tends to be the front line of defense against attacks on the server, just behind the webserver. Any exploit vector needs to be addressed, quickly and consistently. In the PHP community, one of the best ways to manage this is by updating the PHP stack as frequently as possible.

    Performance – Arguably Carrot And Stick

    Older and simpler web pages usually loaded in a reasonable time, but also on less than attractive technologies like T1 lines and dial-up. Today, web pages are much more involved with a ton of JavaScript mixed into the HTML, and these power-hungry pages need a lot of data that PHP can deliver. A few years ago, the PHP community addressed a “challenge” from competitors using the Facebook derivative of PHP by offering up PHPng, which later became PHP 7. The race for performance continues today. With the latest version of PHP 8, we are seeing even more performance improvements.

    It is important to keep in mind that raw performance of a single PHP script, side-by-side may not show a marked improvement to the naked eye. This is primarily due to the gradual slowing of Moore’s Law and the fact that the clock speed of processors has not gained much ground in the last few years. But what we can see is improvements in throughput and utilization of resources under load like significantly reduced memory utilization. For Linux implementations this can mean fewer servers, as illustrated in the case study of Badoo when they adopted PHP 7. For IBM i shops this means more memory and other resources for all the other applications that are keeping busy on the platform.

    Pharonix, an independent firm focused on open source and Linux advocacy, recently published PHP performance statistics illustrating the consistent forward march of improved throughput and reduced resources. Since 30 percent of shops are still running a PHP 5 variant, this means everybody should benefit from improved performance, but clearly YMMV.

    Features of PHP 7, 8, & Beyond: This Is All Carrot . . . But Braised in Caramel Sauce and Topped With Cinnamon

    In addition to PHP 7 delivering stellar performance, there were a number of features introduced as well. A few of these include scalar type declarations, anonymous classes, return type declarations, and one of my personal favorites in constant array declarations via define(). It simply amazed me that after such a zealous focus on performance the core development team managed to sneak in a few of these goodies. What can be really attractive is that folks who had well-written code that was at a PHP 5.6 standard typically enjoyed a simple migration into the world of PHP 7+. But those who had bad habits entrenched in PHP 4 and earlier seem to struggle the most. This is no surprise and is one of the easiest examples of technical debt that we see in PHP migrations.

    Many enhancements for PHP 7 include both OO and procedural features like defining constant arrays.

    PHP 8 builds upon all the success of PHP 7 with a variety of updates. One in particular is the tempered behavior of the @ sign where it no longer silently suppresses certain errors. This is a good start, and we look forward to continued momentum in collectively witnessing the slow death of the most evil (but terribly useful) contraption that has been the bane of many a maintenance programmers existence for quite some time. Additional PHP 8 features include named arguments when calling methods and functions, constructor property promotion, match expressions, and much more. One interesting point about performance is illustrated by a single change in removing PHP 4 style constructors has yielded a 20 percent performance gain.

    This new approach creates cleaner code and makes things more efficient for the developer and the interpreter.

    PHP 8 continues with even more features including a Just-In-Time (JIT) compiler and the ability to process requests asynchronously. Yes, one of the main features of one of those other languages is coming to PHP. I think this is a good time to reflect on the fact that jumping ship from one technology to another because of a single feature might be a little short sighted. I ran into many companies looking to abandon PHP for a language that supported asynchronous requests and found the grass was not all that green. Maybe because of overhyped expectations or possibly because the implementation is not as simple as some might expect. And now, this feature comes to PHP. Not necessarily because the language is trying to compete with other technologies, but more to the fact that PHP enjoys a very active development community who felt it’s time to bring in this feature.

    27 Years And Just Getting Started!

    PHP is really coming into its own with powerful stability and incredible new features. Letting PHP versions fall behind because of security is not a good idea, but when you add in the technical debt of maintaining older versions it can sometimes make getting current a significant task. Many companies simply do not have the time or resources to evaluate compliance with each annual major release of PHP, but that should not be an excuse for allowing the code base to stagnate. Perforce offers the only PHP Long Term Support which can extend production level support beyond the community level. This allows companies some flexibility in keeping up with the technical debt that can sometimes mire the development teams and extend the useful life of a significant PHP code base by offering protection.

    But what if you just don’t have the cycles to “get current” with PHP? With Long Term Support editions for several PHP versions. Perforce extends the industry standard of three years by at least another two years, and often longer. This optional support provides organizations the flexibility to prioritize PHP migrations where they can best fit into organizational objectives. While staying current is always the best course of action, sometimes other priorities take precedent.

    Mike Pavlak is a solution engineer at Perforce.

    This content is sponsored by Perforce Software.

    RELATED STORIES

    Innovating And Thriving with IBM i

    PHP Decisions Loom as Original Distro Reaches End of Life

    Zend Server for IBM i Now 64-Bit, Available Via RPM

    The End is Near for Zend Server Basic PHP

    Get Your PHP on IBM i, Hold the Zend

    Zend Server 2018 Brings PHP 7.2 To IBM i

    Speedy PHP 7 Now Available for IBM i

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: IBM i, Perforce Software, PHP, PHP 4, PHP 5, PHP 5.6, PHP 7, PHP 8, RPG, YMMV

    Sponsored by
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Guru: Flexible Interfaces Expanding The Operating System Matrix For Power10

    Leave a Reply Cancel reply

TFH Volume: 31 Issue: 72

This Issue Sponsored By

  • TL Ashford
  • Perforce Software
  • UCG Technologies
  • Connectria
  • Manta Technologies

Table of Contents

  • Expanding The Operating System Matrix For Power10
  • PHP Is Here To Stay: PHP 8 And Beyond
  • Guru: Flexible Interfaces
  • As I See It: Home Work
  • IBM to Resell DSI’s VTL In Its IBM i Cloud

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • POWERUp 2025 –Your Source For IBM i 7.6 Information
  • Maxava Consulting Services Does More Than HA/DR Project Management – A Lot More
  • Guru: Creating An SQL Stored Procedure That Returns A Result Set
  • As I See It: At Any Cost
  • IBM i PTF Guide, Volume 27, Number 19
  • IBM Unveils Manzan, A New Open Source Event Monitor For IBM i
  • Say Goodbye To Downtime: Update Your Database Without Taking Your Business Offline
  • i-Rays Brings Observability To IBM i Performance Problems
  • Another Non-TR “Technology Refresh” Happens With IBM i TR6
  • IBM i PTF Guide, Volume 27, Number 18

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle