_calebdw Profile Banner
Caleb White Profile
Caleb White

@_calebdw

Followers
188
Following
121
Media
13
Statuses
203

Engineer & OSS Contributor • Husband & Father • ✝️ Psalms 1 You can't build fast if you don’t break often.

Texas
Joined April 2025
Don't wanna be here? Send us removal request.
@_calebdw
Caleb White
5 days
Getting ready to brew my first @terminaldotshop cron shipment
Tweet media one
0
0
0
@_calebdw
Caleb White
14 days
Don't Windoze my Linux!.
@itsfoss2
It's FOSS
14 days
Linus Torvalds and Bill Gates meet for the first time in decades! 🤯 . Are they cooking something up?
Tweet media one
0
0
0
@_calebdw
Caleb White
17 days
Check out my Laraflake (X snowflake identifiers) package if you want the advantages of Uuids/Ulids but without the headaches of a string primary key. The snowflakes fit into a big int!.
@SerhiiFounder
Serhii Korniienko
17 days
What's your primary key?.
0
0
2
@_calebdw
Caleb White
18 days
No one use 6192 (the black square)---I'm using that one now.
@cremieuxrecueil
Crémieux
19 days
Someone slapped together a big dataset of password leaks today. Here's the distribution of pin numbers from a few times those got leaked a while back.
Tweet media one
0
0
0
@_calebdw
Caleb White
21 days
Missed dropping this in the Laravel community when I posted it 😅. If you think `is_null()` is slower than `=== null' check this out 👇.
@_calebdw
Caleb White
21 days
Most devs think `is_null()` is slower than `=== null` in PHP. But the reality is🥁🥁🥁:. `is_null()` and `=== null` compile to the same opcode in the Zend engine—there's no performance difference. Surprised? So was I!. Let's break it down 🧵.
0
0
3
@_calebdw
Caleb White
21 days
10/10 I’ll admit it—this one got me. Scrapped that Laravel PR on the spot 😅. Next time someone nitpicks one of these checks on a PR, just show them this thread!. If you've got another sneaky micro-optimization to test—send it my way. I'll benchmark it 👨‍🔬.
0
0
0
@_calebdw
Caleb White
21 days
9/10 Curious to run the benchmarks yourself?. Here's the full code:.
1
0
1
@_calebdw
Caleb White
21 days
8/10 So what's the takeaway?. - Don't assume syntax means performance. - Don't optimize based on intuition—profile your code. - Poor quality benchmarks can mislead. - PHP's engine is smarter than you think. - When in doubt, go to the source—code doesn't lie.
1
0
1
@_calebdw
Caleb White
21 days
7/10 As for `=== null`?. It gets compiled down to the exact same opcode:. They're both just optimized type comparisons in the engine.
1
0
0
@_calebdw
Caleb White
21 days
6/10 Here's the Zend engine's special handling for `is_null()` during compilation:. And the null type check logic:. It's just a direct type comparison under the hood.
1
0
0
@_calebdw
Caleb White
21 days
5/10 Why?. Because `is_null()` isn't a normal function call—it's specially handled in the Zend engine. Here's the function definition (with a warning!):. Note the comment: it's often optimized away.
1
0
0
@_calebdw
Caleb White
21 days
4/10 The results were surprising (avg for 1M iterations):. - is_null($m): 297.8ms.- $m === null: 298.1ms.- ! $m instanceof Model: 298.7ms.- ! $m: 297.3ms.- empty($m): 298.3ms.- ! isset($m): 297.7ms. All are within the margin of error—the "fastest" result could change if re-run.
1
0
1
@_calebdw
Caleb White
21 days
3/10 So then I wrote a proper benchmark:. - 🧮 1,000,000 iterations × 100 rounds.- 🧹 GC disabled (eliminate collection noise).- 🔀 Shuffle cases every round (avoid ordering bias).- 🧼 Fresh input each call (prevent caching).- 🔥 Warmup rounds (eliminate first-run effects)
Tweet media one
1
0
0
@_calebdw
Caleb White
21 days
2/10 At first, I tried using Laravel's `Benchmark` class, and the result seemed to confirm my assumption. But then I noticed something---watch out for ordering bias!
Tweet media one
1
0
1
@_calebdw
Caleb White
21 days
1/10 So what kicked this off?. I was in the middle of a Laravel PR, replacing all `is_null()` calls with `=== null`, thinking:. "Strict comparisons avoid type juggling. Function calls are slower. Right?". But then I paused: have I actually measured this?.
1
0
0
@_calebdw
Caleb White
21 days
Most devs think `is_null()` is slower than `=== null` in PHP. But the reality is🥁🥁🥁:. `is_null()` and `=== null` compile to the same opcode in the Zend engine—there's no performance difference. Surprised? So was I!. Let's break it down 🧵.
@_calebdw
Caleb White
22 days
Hey Laravel devs 👋. Let’s put your instincts to the test with a quick poll:. Which one is faster?.Cast your vote, then drop a comment with your reasoning 👇.No cheating—go with your gut. I’ll reveal the answer tomorrow. (Follow so you don’t miss it!).
1
0
9
@_calebdw
Caleb White
22 days
Hey Laravel devs 👋. Let’s put your instincts to the test with a quick poll:. Which one is faster?.Cast your vote, then drop a comment with your reasoning 👇.No cheating—go with your gut. I’ll reveal the answer tomorrow. (Follow so you don’t miss it!).
8
1
12
@_calebdw
Caleb White
23 days
Happy Father's Day to all the dads out there!. Being a father is one of the greatest callings you have in life. Your strength, love, and example make a lasting difference—every single day. I love my kids more than words can describe—couldn't imagine life without them. Proverbs.
0
0
0
@_calebdw
Caleb White
25 days
Plot twist: he's a Lua programmer.
@PR0GRAMMERHUM0R
Programmer Humor
25 days
arrayLoveIndexOne
Tweet media one
0
0
1
@_calebdw
Caleb White
26 days
Everyone's losing their minds because Claude Code (and other ai apparently?) is down and I'm over here blissfully unaware in Neovim . You can just code you know. .
0
0
2