haphpiness

These are things in PHP which make me genuinely_happy();

Fatal Error Backtraces

PHP 8.5 finally gives you stack traces on fatal errors. Before, a fatal error like "Maximum execution time exceeded" would tell you what happened but not where in your code it happened. Now you get a full backtrace, just like exceptions.

// Before PHP 8.5:
// Fatal error: Maximum execution time of 30 seconds exceeded
// ... that's it. Good luck finding the infinite loop.

// After PHP 8.5:
// Fatal error: Maximum execution time of 30 seconds exceeded in /app/Services/Import.php on line 142
// Stack trace:
// #0 /app/Services/Import.php(142): processRow(Array)
// #1 /app/Services/Import.php(98): importBatch(Array)
// #2 /app/Console/Commands/Import.php(34): App\Services\Import->run()
// #3 /vendor/laravel/framework/src/Illuminate/Console/Command.php(115): handle()

// Also works for:
// - Allowed memory size exhausted
// - Stack overflow from infinite recursion
// - Any other fatal error

This is particularly valuable in production environments where reproducing a fatal error can be difficult. The backtrace tells you exactly which code path triggered the fatal, turning "something timed out somewhere" into an actionable bug report.

Significance: Debuggability

Fatal errors are the hardest to debug because they kill the process before you can inspect it. Adding backtraces to fatal errors closes one of PHP's oldest debugging gaps. It's the difference between "the server timed out" and "the server timed out in Import::processRow() on line 142" — one is a mystery, the other is a fix waiting to happen.