← Library08 Sources/Ei Maung PDFs

source · pdf · php · backend

PHP 8 On Point

08 Sources/Ei Maung PDFs/PHP 8 On Point.md

PHP 8 On Point

Official source

Actual coverage

World Wide Web; development environment; syntax/types; strings/arrays; operators/control structures; functions; OOP; design patterns; error handling; modules/namespaces; Composer; requests/cookies/sessions; uploads; MySQL; a complete project; security.

Durable knowledge

  • PHP executes on the server within an HTTP request lifecycle; output becomes the response.
  • Separate input parsing, domain rules, persistence, and presentation.
  • Types, visibility, interfaces, exceptions, namespaces, and dependency management make larger programs safer to change.
  • Patterns are tradeoff-bearing structures, not decorations: factories centralize construction, adapters translate interfaces, strategies vary algorithms, and dependency injection exposes dependencies.
  • Sessions establish server-side continuity but require secure cookie settings, regeneration, expiration, and CSRF protection.
  • Uploads are untrusted: limit size/type, generate safe names, store outside executable paths, and scan when risk requires.
  • Use prepared statements, contextual output escaping, password hashing, authorization, and secure error handling.

Project rule

Keep credentials out of source; validate on the server even when the client validates; never expose raw production exceptions.

Knowledge connections