PHP global functions: how they affect code extensibility, testability and modularity

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • PHPUnit

    The PHP Unit Testing framework.

    Solution with dependency injection described above gives us opportunity to choose custom logger object. With the help of testing framework such as PHPUnit we can create stub object instead of regular logger object, which allows us to freely redefine or suppress object functionality for purposes of the test and also watch which methods on the logger object has been called from inside of tested module (mocking). Neither of these features can be achieved when implementing logging with a global function.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts