PHP (8.5)

This assessment applies the coupling account — coupling as access to a shared resource, and the coupling floor [1], [2] — and the knowledge-embodiment theorem [3]; the language is assessed against its official reference [4].

Snapshot PHP (8.5) — released 20 November 2025 · lifecycle current

Family PHP — shelf: Web

The language’s centre of gravity is the browser or the HTTP request and response model. A shelf groups; it does not classify — the tags below carry every use, paradigm, and platform of this snapshot.

Trajectory PHP/FI (8 June 1995 — first public release) · 8.5 (20 November 2025 — assessed release)

Tags

Use — Application, Web back end

Paradigm — Object-oriented, Imperative, Procedural

Lifecycle — Current

Memory — Reference counted

Typing — Static, weak

Resources

The language’s official entry points, and the documents that name the release this page assesses. A link marked this release pins the document to PHP (8.5); an unmarked link is the current reference for the language.

Landing page

Specification and reference

API documentation

Tutorial

Release notes

Package registry

1 Assessment

This page assesses PHP in five parts: core coupling — what the language’s own constructs force; ecosystem coupling — what the surrounding platform, tooling, and community cost; engineering readiness — whether the artifact can be reproduced, verified, observed, worked in quickly, connected to other languages, and governed openly; the profile — the unscored facts a score cannot express; and the scoring detail — the mechanism marks and the arithmetic behind every score. A ✅ bullet marks a construct that helps. A ⚠️ or ❌ bullet marks a cost; the scoring model does not price every cost named here.

Core coupling 51.7/100 · Ecosystem coupling 78.5/100 · Engineering readiness 73.1/100

1.1 Core coupling

1.1.1 Type

  • ⚠️ Type declarations (PHP 7+): Gradual typing, improving
  • ✅ Interfaces decouple: Can program to interfaces
  • ❌ Weak typing historically: Type juggling couples
  • ⚠️ Traits: Multiple inheritance-like, can couple
  • ❌ Inconsistent stdlib: strpos vs str_replace couples to memorization
  • ✅ Namespaces scope every name: A namespace declaration qualifies a class, function, or constant, so two libraries can define the same short name
  • ⚠️ Magic methods can hide coupling: __get, __call obscure behavior

1.1.2 Construction

  • ⚠️ Constructors can have side effects: No enforcement
  • ❌ No immutability by default: Everything mutable
  • ⚠️ Dependency injection available: Frameworks support it
  • ❌ Global state tempting: $_GET, $_POST, $_SESSION couple
  • ❌ One value, many names: objects move by handle (documented), so two variables reach one instance; arrays copy, objects share, and the declaration names nothing (C6)
  • ❌ Execution moves with no call in sight: unserialize runs the object hooks the class defines at a site the source shows as data, and the call is the format’s choice (C7)
  • ❌ include/require executes top-level code at load; a cyclic include sees the half-defined file (C8)

1.1.3 Memory

  • ✅ Reference counting: Immediate deallocation when references drop to zero
  • ✅ Cycle collector: Detects and breaks circular references (M7)
  • ✅ Request-scoped by default: Each request has isolated memory, cleared after request
  • ❌ Long-running processes leak: Traditional PHP has no long-lived processes, but Swoole/ReactPHP do
  • ✅ No manual memory management: Can’t have use-after-free in pure PHP
  • ⚠️ Extensions can leak: C extensions may have memory issues
  • ❌ The undeclared class has no catch: the memory-limit fatal ends the request (the Allowed-memory-size-exhausted fatal error is not a Throwable — the engine cannot allocate to throw it), and the stack-overflow class entered the declared surface in 8.3, where the default configuration throws a catchable Error (zend.max_allowed_stack_size, documented to prevent stack-overflow-induced segmentation faults) (Er6)

1.1.4 Error

  • ❌ Exceptions unchecked: No type tracking
  • ⚠️ Error vs Exception confusion: Two error mechanisms couple
  • ❌ @ operator suppresses errors: Hides coupling
  • ⚠️ Modern frameworks handle better: Laravel/Symfony impose discipline
  • ❌ A fault ends the script: a fatal error terminates execution (documented); the per-request boundary belongs to the SAPI, not the language (Er5)

1.1.5 Concurrency

  • ❌ Shared-nothing by default: Each request is separate process
  • ✅ Fibers (PHP 8.1): Built-in cooperative concurrency — enables async I/O without external extensions
  • ⚠️ No built-in async event loop: Fibers need a framework (ReactPHP, Swoole) for full async; however Revolt/Amp provide fiber-based event loops
  • ❌ Global state couples across requests: Sessions, databases

1.1.6 Platform

  • ✅ No company owns the language: PHP is maintained by The PHP Group and released under the PHP Licence, a permissive BSD-style licence
  • ✅ The reference implementation is free software: The Zend Engine is developed in the open and shipped by every Linux distribution
  • ✅ The interpreter is portable: PHP runs on Linux, macOS, and Windows, under Apache, nginx through PHP-FPM, and IIS
  • ✅ Commodity hosting provides it: Most shared hosts include a PHP runtime, so deployment needs no platform purchase
  • ✅ No single distribution is required: Distribution packages, official builds, and vendor bundles run the same language

1.1.7 Trade-offs (not coupling)

  • The language began as a page preprocessor: PHP grew from a templating tool, so markup and logic still share one file — a design origin whose cost is mixed presentation and behaviour
  • Every variable carries a $: The sigil marks a variable at a glance and cannot be omitted, a notation decision rather than a type-system one
  • The core library assumes one short request: Functions such as header() and session_start() act on the current request, an assumption that costs when the same code must run in a long-lived worker
  • Frameworks define the architecture: PSR interfaces and the Laravel or Symfony conventions shape practice more than the language does — an ecosystem convention, not a dependency the language forces
  • Feature growth is version-gated: Enums, readonly classes, and property hooks arrive release by release, so the style a codebase may use follows its minimum supported version — an evolution cost, not a coupling

1.2 Ecosystem coupling

1.2.1 Performance

  • ⚠️ Interpreted: Slower than compiled languages
  • ✅ PHP 8+ JIT: Significant improvements for CPU-bound workloads
  • ⚠️ Shared-nothing: Each request starts fresh (couples to memory)
  • ✅ Fibers: Cooperative concurrency without process overhead
  • ⚠️ OPcache helps: But couples deployment to caching

1.2.2 Ecosystem

  • ✅ Composer: Good package manager
  • ✅ Large ecosystem: Packagist has many packages
  • ✅ Laravel, Symfony: Mature frameworks
  • ✅ IDE support: PHPStorm excellent, VSCode good
  • ⚠️ Quality varies: Many low-quality packages
  • ❌ An extension binds to a release: PHP policy updates PHP_API_VERSION and the module API numbers for each new release branch [5] (Ec8)
  • ⚠️ Stored serialized strings bind to the release by silence: the manual states the format is a byte-stream representation that can be stored anywhere, and documents no version field and no cross-release compatibility, so the row is recorded and prices nothing. The probe harness round-tripped every writer and reader pair from 8.0.30 to 8.4.14 with no break reproduced — tested is not promised [6] (Ec9)

1.2.3 Evolution

  • ✅ Improving rapidly: PHP 8.1-8.5 added enums, fibers, readonly, property hooks, asymmetric visibility, clone with, pipe operator
  • ✅ Regular releases: Yearly cadence
  • ⚠️ Legacy burden: Must support old code (PHP 5.x still in the wild)
  • ❌ Inconsistent stdlib: function_name vs functionName — PHP 8.x is standardizing but still inconsistent

1.2.4 Domain

  • ✅ Excellent for traditional web: WordPress, Drupal, Laravel
  • ⚠️ Backend only: Can’t do frontend (obviously)
  • ✅ Fibers enable async: Modern PHP can do async I/O natively
  • ⚠️ CLI possible: But uncommon relative to Python/Ruby
  • ❌ No systems programming: Not suitable

1.2.5 Learning

  • ✅ Very gentle: Easy to start
  • ✅ Lots of resources: Tutorials, documentation
  • ⚠️ Bad habits easy: Superglobals, $ prefix confusion
  • ✅ Quick productivity: Deploy immediately

1.2.6 Syntax

  • ⚠️ C-like syntax: Familiar but verbose
  • ✅ Property hooks (8.4): Eliminates getter/setter boilerplate
  • ✅ Asymmetric visibility (8.4): Clean access control
  • ❌ Superglobals: $_GET, $_POST everywhere
  • ❌ Inconsistent stdlib: Hard to remember function names

1.2.7 Testing

  • ✅ PHPUnit: Industry standard
  • ⚠️ Xdebug: Works but setup needed
  • ✅ Property hooks + readonly: Easier to test (less setup)
  • ⚠️ Error reporting: Improving with strict types

1.2.8 Security

  • ✅ Memory safe: GC prevents memory bugs
  • ❌ SQL injection: Easy to do wrong (prepared statements help but not enforced)
  • ❌ XSS: Template systems help but not enforced
  • ❌ Superglobals: Injection attack surface
  • ⚠️ Modern frameworks help: But not language-level
  • ❌ An overflowing integer is converted to float in place, documented and silent (Q4)

1.2.9 Delivery targets

What ships from a producer to a consumer, and whether the interface across a release boundary is promised. Ec8 is present when one compiled target crosses with no promise.

Target Ships as Crosses a producer boundary Cross-release promise
Composer package source no A package ships PHP source
extension compiled yes no — PHP policy bumps PHP_API_VERSION and the module API numbers for each new release branch [5]

1.2.10 Stored data formats

What the toolchain stores that outlives the program, and what the vendor publishes about reading it across a release boundary. Ec9 is present when one row carries a break: the reading promise published as broken, the writing direction published as unreadable elsewhere, or a break the probe harness has reproduced.

Stored format Reading promise Writing promise
serialize() string — stored values recorded, not priced — The manual states the format is a byte-stream representation of any value that can be stored anywhere, and the page documents no version field and no cross-release compatibility for the format. The probe harness round-tripped 15 payload shapes across every writer and reader pair from 8.0.30 to 8.4.14 with no break reproduced, so the format is tested and still unpromised [6] —

1.3 Engineering readiness

1.3.1 Reproducibility

  • ❌ No contract the toolchain reads: the runtime ships no manifest reader, and the ecosystem’s package manager is installed beside it, not with it (Y18)

1.3.2 Supply chain

  • ❌ Composer packages carry no signed provenance by default. (Y3)
  • ✅ Packagist namespaces every package by vendor. (Y4)
  • ✅ The PHP project announces security fixes with each release. (Y16)

1.3.3 Observability

  • ✅ An uncaught error or exception prints a fatal report naming the stack. (Y15)
  • ⚠️ error_log and the SAPI logs are the built-ins; structure is the application’s job.

1.3.4 Feedback

  • ❌ No debugger ships with the interpreter; Xdebug is third-party. (Y13)

1.3.5 Interop

  • ✅ The FFI extension reaches C libraries in process. (Y9)
  • ✅ The interpreter is maintained for every common platform and web stack. (Y10)

1.3.6 Governance

  • ✅ The PHP Group and the public RFC process run the language. (Y11)
  • ✅ The language reference and the RFC archive are public. (Y12)
  • ✅ The interpreter source is public. (Y19)

1.4 Profile

Unscored, and kept separate from every score on purpose. The profile records what a mechanism price cannot express: what a running program costs, how well a coding model and an agent work in the language, and whether a safety-critical path exists.

1.4.1 Energy and cost

What this axis asks: what does a running program cost in energy and time?

  • ❌ Interpreted by default: the slowest class in the energy and time benchmarks [7]; a causal re-analysis attributes most of the gap to execution time [8].

1.4.2 AI and agent readiness

What this axis asks: how well does a coding model and an agent work in this language?

  • ✅ A large training corpus and strong code-generation results: models write this language well [9], [10].

1.4.3 Safety certification

What this axis asks: is there a certified or standards-qualified path to a safety-critical system?

  • ⚠️ No certified or standards-qualified path for safety-critical systems.

1.5 Scoring detail

1.5.1 Core coupling Dimensions

Dimension Mechanism Description Imposed by Present Weight
Type T1 dynamic no static check language ✅ −15
T2 weak static language ✅ −8
T3 dynamic/duck dispatch language — 0
T4 no sum types language — 0
T5 no generics language ✅ −4
T6 no namespaces language — 0
T7 type erasure/reflection language — 0
T8 operator overloading language — 0
T9 inheritance required for polymorphism language — 0
T10 no null-safety language ✅ −8
T11 no module boundary language — 0
T12 no effect tracking language ✅ −8
T13 async/sync colouring language — 0
T14 unchecked foreign boundary language ✅ −4
T15 chars are encoding units language — 0
Type cost −13.4 (−47)
Construction C1 global mutable state by default language ✅ −15
C2 no immutability by default language ✅ −4
C3 constructors coupled to allocation language — 0
C4 no constructor/validation language — 0
C5 unpinned collection order language — 0
C6 aliasing by default language ✅ −8
C7 undeclared control transfer language ✅ −8
C8 no source-visible init order language ✅ −8
Construction cost −12.3 (−43)
Memory M1 manual deallocation runtime — 0
M2 GC non-deterministic pauses runtime — 0
M3 no RAII language ✅ −4
M4 no ownership model language ✅ −8
M5 uninitialized reads language — 0
M6 unchecked reinterpretation language — 0
Er6 uncatchable runtime fault language ✅ −8
M7 reference cycles leak runtime — 0
Memory cost −5.7 (−20)
Error Er1 no structured path language — 0
Er2 unchecked exceptions only language ✅ −8
Er3 errors ignored/non-exhaustive language ✅ −4
Er4 no composable result type language ✅ −4
Er5 no isolation unit for a fault runtime ✅ −8
Error cost −6.9 (−24)
Concurrency K1 GIL/no parallel runtime ✅ −15
K2 shared mutable state default language ✅ −8
K3 manual sync no race detection runtime ✅ −8
K4 no structured concurrency language ✅ −4
K5 no primitives language — 0
K6 thread-per-task cost runtime — 0
Concurrency cost −10.0 (−35)
Platform P1 cannot function outside one vendor/domain context — 0
P2 single-vendor but other uses context — 0
P3 legacy/discontinued platform context — 0
P4 poor domain fit context — 0
Platform cost 0

Core coupling score: 51.7/100 — 169 of the 350 inventory points are present, so the axis cost is 100 × 169 ÷ 350 = 48.3 and the score is 100 − 48.3. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.

1.5.2 Ecosystem coupling Dimensions

Dimension Mechanism Description Imposed by Present Weight
Performance R1 interpreted no AOT/JIT runtime — 0
R2 GC pauses runtime — 0
R3 JIT warmup runtime — 0
Performance cost 0
Ecosystem Ec1 no package manager context — 0
Ec2 fragmented tooling context — 0
Ec3 small/niche/discontinued context — 0
Ec4 proprietary context — 0
Ec5 platform-locked tooling context — 0
Ec6 monoculture context ✅ −8
Ec7 legacy burden context — 0
Ec8 unpromised binary boundary context ✅ −8
Ec9 unpromised data boundary context — 0
Ecosystem cost −6.2 (−16)
Evolution V1 breaking changes language — 0
V2 frozen context — 0
V3 discontinued context — 0
V4 glacial standards context — 0
V5 silent default drift runtime — 0
V7 build-variant state space context — 0
Evolution cost 0
Domain D1 domain/vendor lock-in context — 0
D3 framework forces architecture context — 0
Domain cost 0
Learning L1 steep context — 0
L2 large surface/multi-paradigm context — 0
L3 sparse docs context — 0
Learning cost 0
Syntax S1 verbose language — 0
S2 inconsistent language ✅ −8
S3 punctuation-heavy language — 0
Syntax cost −3.1 (−8)
Testing G1 weak tooling context — 0
G2 poor debugging context — 0
G3 runtime-only errors context — 0
G4 no published monotonic clock runtime — 0
Testing cost 0
Security Q1 memory-unsafe language — 0
Q2 dynamic/weak typing risk language ✅ −8
Q3 known vulnerability/injection context ✅ −8
Q4 silent integer overflow language ✅ −15
Security cost −12.1 (−31)

Ecosystem coupling score: 78.5/100 — 55 of the 256 inventory points are present, so the axis cost is 100 × 55 ÷ 256 = 21.5 and the score is 100 − 21.5. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.

1.5.3 Engineering readiness Dimensions

Dimension Mechanism Description Imposed by Present Weight
Reproducibility Y1 build not reproducible context ✅ −15
Y2 dependencies not pinned context — 0
Y14 no toolchain version pin context — 0
Y18 no machine-read project contract context ✅ −8
Reproducibility cost −13.5 (−23)
Supply chain Y3 no signed provenance context ✅ −15
Y4 registry without namespacing context — 0
Y16 no advisory feed context — 0
Supply chain cost −8.8 (−15)
Observability Y5 no stable tracing standard context — 0
Y6 no structured logging context — 0
Y15 no post-mortem diagnostics runtime — 0
Observability cost 0
Feedback Y7 slow build context — 0
Y8 no fast in-editor analysis context — 0
Y13 no bundled debugger context ✅ −8
Feedback cost −4.7 (−8)
Interop Y9 no foreign-function interface language — 0
Y10 no portable target context — 0
Interop cost 0
Governance Y11 single-vendor governance context — 0
Y12 closed specification context — 0
Y17 no conformance mechanism context — 0
Y19 no published parser context — 0
Governance cost 0

Engineering readiness score: 73.1/100 — 46 of the 171 inventory points are present, so the axis cost is 100 × 46 ÷ 171 = 26.9 and the score is 100 − 26.9. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.

Verdict: PHP is steadily improving its coupling profile. Enums (8.1), readonly classes (8.2), property hooks and asymmetric visibility (8.4) add compile-time structure. Fibers (8.1) enable built-in async. Superglobals create pervasive coupling. Shared-nothing architecture prevents temporal coupling but wastes resources. Main strength: simplicity for web, rapid improvement cadence. Main weakness: superglobals, inconsistent stdlib, no standard async runtime.


The formal development. The definitions, theorems, and proofs behind this page are published in:

All published papers

References

[1]
Y. Loth, “On the nature of coupling: All coupling as shared resource access.” Zenodo, Aug. 2026. doi: 10.5281/zenodo.21925121.
[2]
Y. Loth, “Coupling as a consequence of cohesion: Decomposition, the coupling floor, and domain-imposed coupling.” Zenodo, Aug. 2026. doi: 10.5281/zenodo.21925201.
[3]
Y. Loth, “On the nature of cohesion: Cohesion as correctness relative to a partitioning rule.” Zenodo, Jul. 2026. doi: 10.5281/zenodo.20492912.
[4]
The PHP Group, “PHP manual.” The PHP Group, 2024. Available: https://www.php.net/manual/
[5]
The PHP Group, “PHP release process policy.” The PHP Group, 2026. Available: https://github.com/php/policies/blob/main/release-process.rst
[6]
The PHP Documentation Group, “PHP manual: Serialize — generate a storable representation of a value.” The PHP Documentation Group, 2026. Accessed: Oct. 26, 2026. [Online]. Available: https://www.php.net/manual/en/function.serialize.php
[7]
R. Pereira et al., “Energy efficiency across programming languages: How do energy, time, and memory relate?” in Proceedings of the 10th ACM SIGPLAN international conference on software language engineering (SLE), 2017, pp. 256–267. doi: 10.1145/3136014.3136031.
[8]
N. van Kempen, H.-J. Kwon, D. T. Nguyen, and E. D. Berger, “It’s not easy being green: On the energy efficiency of programming languages,” in Proceedings of the 40th IEEE/ACM international conference on automated software engineering (ASE), 2025. doi: 10.1109/ASE63991.2025.00131.
[9]
S. Joel, J. J. Wu, and F. H. Fard, “A survey on LLM-based code generation for low-resource and domain-specific programming languages,” ACM Transactions on Software Engineering and Methodology, 2025, doi: 10.1145/3770084.
[10]
Y. Qing et al., “EffiBench-x: A multi-language benchmark for measuring efficiency of LLM-generated code,” in Advances in neural information processing systems 38 (NeurIPS), datasets and benchmarks track, 2025. doi: 10.48550/arXiv.2505.13004.