Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

H - Covered PHP Features

Every chapter in this book introduces a piece of PHP: a keyword, an operator, a built-in interface, a language mechanism. This appendix pulls them all into one list, each one linked to its entry in the PHP Dictionary, an independent, ever-growing reference of PHP terms, keywords, functions, and jargon. Use it the way you’d use any glossary: when a term from an earlier chapter comes back and you want the short version again, without hunting back through the chapter that first introduced it.

A handful of items below have no dictionary entry yet. They’re listed anyway, plainly, without a link.

Syntax and basics

Types and comparison

Control flow

Functions and closures

Classes and objects

Enums

Namespaces and autoloading

  • Namespaces and use imports: organizing and importing names, from Chapter 7.
  • Autoloading: loading class files on demand instead of with a pile of require statements.
  • PSR-4: the autoloading standard Composer implements, covered in Chapter 7. Not yet in the dictionary; only mentioned there in passing.

Error handling

Web and databases

Debugging

  • var_dump(), print_r(), and var_export(): printing a value’s structure (and, for var_dump(), its type) while chasing a bug, from Chapter 13.
  • Xdebug: a step debugger and profiler, pausing execution at a breakpoint instead of guessing where to print, from Chapter 13.
  • Profiling: measuring where a script actually spends its time, one of Xdebug’s other jobs.

Concurrency

  • pcntl: the extension behind forking and controlling separate OS processes.

Reflection and attributes

  • Reflection: inspecting classes, methods, properties, and attributes at runtime, from Chapter 20.
  • Magic constants (__CLASS__, __FUNCTION__, __METHOD__, __LINE__, __FILE__): compile-time constants describing the code’s own location.
  • Attributes #[...]: structured metadata attached to code and read back through Reflection, from Chapter 20.

Built-in interfaces

Odds and ends

  • global: pulling a variable in from the global scope.
  • Copy-on-write: why passing an array by value is cheap until something actually writes to it, from Chapter 4.
  • Garbage collection: how PHP reclaims memory from objects nobody references anymore.
  • assert(): a debug-time sanity check, from Chapter 12.
  • PHPUnit: the testing framework used throughout the book’s later chapters.
  • getenv() and $_ENV: reading environment variables, from Chapter 14.
  • fwrite(STDERR, ...): writing to standard error instead of standard output.
  • Output buffering: capturing generated output into a buffer instead of sending it immediately.
  • register_shutdown_function(): a callback PHP guarantees to run at the end of a script, from Chapter 21.
  • $this and STDIN: both used constantly from Chapter 2 onward, neither has its own dictionary entry yet.
  • random_int(): PHP’s cryptographically secure random integer function, also not yet listed.

The gaps are worth noticing as much as the links. A few things this book leans on hard ($this, STDIN, PSR-4, custom exception classes) don’t have an entry in the dictionary yet. If you find yourself explaining one of them to someone else, that explanation is most of a dictionary entry already.