Architect

Level: Architect | Docker: php:8.3-cli | All labs Docker-verified

This track covers advanced PHP internals, concurrency, security, distributed systems patterns, and production platform engineering. Every lab includes Docker-verified code examples with real output.


Prerequisites

  • PHP 8.1+ concepts (match, enums, fibers, attributes)

  • Familiarity with design patterns (DDD, SOLID)

  • Basic SQL and SQLite knowledge

  • Docker installed locally

Quick Start

# Start Docker environment
docker run -it --rm php:8.3-cli bash

# Verify environment
php -v
php -m | grep -E 'OPcache|sodium|PDO'

Lab Index

#
Lab
Topics
Time

01

OPcache, zval, CoW, tokenizer

60 min

02

PHP 8 JIT modes, benchmarks, opcache.jit=1255

60 min

03

Fibers, cooperative scheduler, async simulation

60 min

04

FFI::cdef(), libc, structs, pointers, callbacks

60 min

05

stream_wrapper_register, SQLite-backed db://

60 min

06

SplFixedArray, heaps, priority queues, iterators

60 min

07

ReflectionClass, Attributes, DI container, proxies

60 min

08

libsodium: XSalsa20, Ed25519, Argon2id, BLAKE2b

60 min

09

Future, async(), delay(), cancellation

60 min

10

EventStore, aggregates, projections, snapshots

60 min

11

Circuit breaker, retry, rate limiter, bulkhead

60 min

12

Proto3 messages, client stub, metadata, interceptors

60 min

13

OpenTelemetry, spans, metrics, Monolog JSON

60 min

14

OPcache tuning, benchmarks, memory profiling

60 min

15

Full integration + PHPUnit 10 (7 tests)

90 min

Total: ~870 minutes (~14.5 hours)


Learning Path


Key Skills Developed

PHP Runtime Mastery

  • Zend Engine internals: zval types, copy-on-write memory model

  • OPcache configuration for production (validate_timestamps, preloading)

  • JIT compiler modes (function JIT 1255, tracing JIT 1205) and when to use each

  • Performance profiling with hrtime(), memory_get_usage(), custom benchmarking

Systems Programming

  • PHP FFI: calling C libraries (libc), struct manipulation, memory management

  • Custom stream wrappers: transparent protocol implementation

  • Fiber-based cooperative multitasking without external frameworks

Concurrency & Async

  • PHP 8.1 Fibers: lifecycle, scheduling, error propagation

  • Amp v3: Future, async(), delay(), cancellation tokens

  • Cooperative scheduler implementation from scratch

Security Engineering

  • libsodium: authenticated encryption (XSalsa20-Poly1305), digital signatures (Ed25519)

  • Key derivation: Argon2id with INTERACTIVE/SENSITIVE parameters

  • Secure token systems: Ed25519-signed, encrypted JWT-style tokens

  • Constant-time comparison, memory zeroing with sodium_memzero

Distributed Systems

  • Event Sourcing: append-only event store, aggregate reconstitution, projections, snapshots

  • Circuit breaker: Closed/Open/HalfOpen state machine with configurable thresholds

  • Retry with exponential backoff and full jitter

  • Token bucket rate limiter, bulkhead pattern, distributed locking

Platform Engineering

  • OpenTelemetry: TracerProvider, span hierarchies, W3C context propagation

  • gRPC: proto3 message design, client stubs, interceptor chains, status codes

  • Reflection-based DI container with constructor autowiring

  • PHPUnit 10 testing: unit tests for all platform components


Docker Reference


Extension Availability in php:8.3-cli

Extension
Available
Notes

OPcache

php -d opcache.enable_cli=1

sodium

Built-in since PHP 7.2

PDO + pdo_sqlite

SQLite available

Fibers

PHP 8.1+ core

FFI

Needs --with-ffi compile flag; use php:8.3-fpm

grpc

Install via pecl

xhprof

Install via pecl


References

Last updated