Turbo Learn PHP

Quick PHP chats, tips, and insights in a fast, simple format

Turbo Learn PHPTurboLearnPHP
2026-03-14

How to Sort by Multiple Fields With usort

One comparison function. Sort by name then age. No loops.

youtube.com/watch?v=IWUKiotoGMY

Turbo Learn PHPTurboLearnPHP
2026-03-13

How to Capture Variables in Closures

use ($var) brings outer scope in. Read. Modify with use (&$var).

youtube.com/watch?v=9KqC_XBx608

Turbo Learn PHPTurboLearnPHP
2026-03-13

How to Replace switch With match in PHP 8

match is strict. No fall-through. Returns a value. One expression.

youtube.com/watch?v=BFaQXqsGYS4

Turbo Learn PHPTurboLearnPHP
2026-03-13

Why does this PHP retry charge customers twice?

Why does this PHP retry logic charge customers twice in production. The PHP code retries a payment call after a timeout without an idempotency key, so the gateway processes duplicates. In PHP billing services this creates double charges and refunds.

...

youtube.com/watch?v=rITaVoDHgWY

Turbo Learn PHPTurboLearnPHP
2026-03-12

How to Use Ternary and Null Coalesce

? : for if-else. ?? for null fallback. ??= for assign if null.

youtube.com/watch?v=tcPHVhKaKk8

Turbo Learn PHPTurboLearnPHP
2026-03-11

File Get Contents Loads 2GB Crashing 47 Web Servers?!

MEMORY EXPLOSION! file_get_contents() loads ENTIRE 2GB file into RAM! 47 web servers CRASHED! Tax deadline missed! 12K users disconnected! $12M class action lawsuit! Lead developer FIRED!

youtube.com/watch?v=7mhJQ1u608A

Turbo Learn PHPTurboLearnPHP
2026-03-11

Why is this PHP temp file creation risky?

Why is this PHP temp file creation risky in a report worker. The PHP code writes to a predictable path in /tmp, which can be hijacked with symlinks. In PHP servers this can overwrite sensitive files.

...

youtube.com/watch?v=e4JN1Py5Kuw

Turbo Learn PHPTurboLearnPHP
2026-03-09
Turbo Learn PHPTurboLearnPHP
2026-03-09

How to Prevent File Upload Path Traversal

Two dots can escape any upload folder.

youtube.com/watch?v=Uett5oHrzjg

Turbo Learn PHPTurboLearnPHP
2026-03-07

How to Shuffle Arrays Randomly

shuffle mutates. array_rand picks keys. Know the difference.

youtube.com/watch?v=HBGuQVOupnI

Turbo Learn PHPTurboLearnPHP
2026-03-07

Array Merge RESETS Numeric Keys Destroying 2.3M Order IDs?!

ARRAY_MERGE DISASTER! Numeric keys RESET to 0,1,2,3! Order 1001 becomes 0! Payment records can't match! 2.3M orders lose IDs! $8.7M shipping chaos! Database architect FIRED!

youtube.com/watch?v=d99qNe0FXXw

Turbo Learn PHPTurboLearnPHP
2026-03-06

Float Precision Issue

Does 0.1 + 0.2 equal 0.3 in PHP? The answer will surprise you! Float precision trap that catches everyone!

youtube.com/watch?v=J5nYvIAH9GA

Turbo Learn PHPTurboLearnPHP
2026-03-06

Why does this PHP error_reporting hide the real exception?

Why does this PHP error_reporting hide the real exception in a catch. The PHP code sets error_reporting to 0 inside try. In PHP error handling this suppresses the actual error and hides root cause.

...

youtube.com/watch?v=44LQV56ZrKg

Turbo Learn PHPTurboLearnPHP
2026-03-06

Why does this PHP SplFileObject seek break iteration?

Why does this PHP SplFileObject seek break iteration in a parser. The PHP code seeks during foreach over the same object. In PHP file parsing this causes skipped or repeated lines.

...

youtube.com/watch?v=H2iD_KK2ikU

Turbo Learn PHPTurboLearnPHP
2026-03-05

How to Stop assert From Becoming eval in Production

assert with string runs eval. One debug leftover and your server is owned. PHP 7.2 changed it.

youtube.com/watch?v=XAO0esf0L78

Turbo Learn PHPTurboLearnPHP
2026-03-05

How to Sanitize Input With filter_input

Filter input early to block obvious junk.

youtube.com/watch?v=bWBMIKqgwmc

Turbo Learn PHPTurboLearnPHP
2026-03-04

How to Stop DateTime From Using the Wrong Timezone

Timezone defaults can flip comparisons in production.

youtube.com/watch?v=hd_jttCuiRs

Turbo Learn PHPTurboLearnPHP
2026-03-04

What's wrong with this PHP array_search check?

What's wrong with this PHP array_search check in an allowlist. The PHP code treats index 0 as false, so the first allowed user is rejected. In PHP access control this silently blocks valid requests.

...

youtube.com/watch?v=8XHDpL1oR88

Turbo Learn PHPTurboLearnPHP
2026-03-03

How to Get First or Last Key Without reset

array_key_first and array_key_last. No side effects. PHP 7.3+

youtube.com/watch?v=DaYMw0a0WrY

Turbo Learn PHPTurboLearnPHP
2026-03-03

This PHP Move Crushes Factory New Everywhere

💡 Level Up Your PHP! This PHP Move Crushes Factory New Everywhere shows the difference between old and modern PHP. Learn PHP 8 features that will change your code! Your code quality will improve!

...

youtube.com/watch?v=bqDWC2SbxQQ

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst