Tips tagged with "PHP"

Browse all tips tagged with PHP.
shape
shape
shape
shape
shape
shape
shape
shape

PHP Hard

Bloom Filters in Practice: How They Work, False Positive Math, Sizing, PHP and Redis

Skip millions of database lookups with a few MB of bits. How Bloom filters work, the false positive math, sizing, PHP code and Redis BF commands.

PHP 8.4 Redis 8.0 Python 3.12
Diagram Try the challenge
10 min Read tip
PHP Medium

PHP Readonly Classes and Value Objects: Money, Email and Immutable Data That Cannot Be Corrupted

Shared mutable objects cause silent data bugs. Use PHP readonly properties and classes to build Money and Email value objects, with-ers and Eloquent casts.

PHP 8.4 Laravel 13
Diagram Try the challenge
11 min Read tip
PHP Medium

PHP Generators for Memory-Efficient Processing: yield, yield from, send() and LazyCollection

Stream a 2 GB CSV in 2 MB of RAM. How PHP generators work: yield with keys, yield from, send(), Laravel LazyCollection, cursor vs lazyById.

PHP 8.4 Laravel 13
Diagram Try the challenge
11 min Read tip
Laravel Medium

Laravel Pipelines: Turn a 340-Line Checkout Controller into Small, Testable Steps

Use the Laravel Pipeline facade to split checkout flows and query filters into pipe classes you can reorder, reuse and unit test, with the pitfalls to avoid.

Laravel 13 PHP 8.4
Diagram Try the challenge
9 min Read tip
PHP Medium

PHP Enums Beyond the Basics: Backed Enums, Methods, tryFrom and Eloquent Casts

One 'canceled' vs 'cancelled' typo can strand orders for days. Use backed enums with methods, interfaces, tryFrom and Eloquent casts to kill magic strings.

PHP 8.4 Laravel 13 Python 3.12
Diagram Try the challenge
11 min Read tip
Security Medium

Password Hashing Done Right: bcrypt vs Argon2id, Cost Tuning and Rehash on Login

MD5 and SHA-256 crack in hours once a dump leaks. Pick bcrypt or Argon2id, tune the cost on real hardware and upgrade old hashes on login in PHP and Laravel.

PHP 8.4 Laravel 13 Python 3.13
Diagram Try the challenge
11 min Read tip
PHP Easy

Preventing SQL Injection in PHP

Learn essential techniques to protect your PHP applications from SQL injection attacks.

PHP 8.0+
Diagram
2 min Read tip
PHP Medium

PHP 8.4 Property Hooks Explained

Discover the new property hooks feature in PHP 8.4 that provides a cleaner way to add logic to property access.

PHP 8.4
1 min Read tip
Laravel Medium

Laravel Query Optimization with Eager Loading

Learn how to optimize database queries in Laravel by using eager loading to prevent N+1 query problems.

Laravel 11.x PHP 8.2+
Diagram
2 min Read tip