frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

PHP's Oddities

https://flowtwo.io/post/php%27s-oddities
13•thejoeflow•3d ago

Comments

ceejayoz•22m ago
Every time I work in another language I miss PHP’s arrays.
rokkamokka•20m ago
They are an incredibly versatile tool for sure. Even more so wrapped in a Laravel Collection
spiderfarmer•10m ago
Absolutely. If you don’t know PHP arrays aren’t actually arrays, the other languages feel inferior.
bakugo•6m ago
For me, it's the exact opposite. Every time I work with PHP, I wish I could have TypeScript's properly typed arrays and dictionaries instead of the janky untyped 2-in-1 mess it actually has.
hparadiz•14m ago
I ended up writing a simple collection class with in-memory indexing twice already in two different monoliths. Maybe I should make an extension.....
nasretdinov•12m ago
if("0") {} being equivalent to if(false) {} still gives me nightmares even though I've stopped using PHP for at least 6 years now :)
kif•10m ago
Also `empty("0") === true` is a common gotcha.
spiderfarmer•9m ago
I think the “bad rep” is coming from developers that stopped developing themselves.
mfonda•7m ago
After nearly two decades of working in PHP, I'm now working in Java. PHP is basically Java-lite. I am absolutely loving the compile-time safety of Java, but I dearly miss PHP's maps and arrays. In Java, the amount of verbosity for defining a map/list and operating on it is overwhelming.

Modern PHP is great. Many powerful language features, excellent performance, great community and package ecosystem, and decent enough safety with modern static analysis tools.

I'm not too sure I agree with the author's complaints here. When using something like array_filter, you're typically mapping from collection to collection (i.e. you don't care about the first element--you care about the whole thing) and so this "problem" is really a non-issue. The next follow up step would usually be foreach, or another operation like array_map, in which case it's a non-issue.

If you really do need the first element, you can use array_first. And if you really do need a fixed-sized collection, you can use SplFixedArray.

The point on properties is valid to an extent, but IMO not really an issue you commonly run into in the real world (regardless of language, your constructors should generally return an object in a usable state).

makeitdouble•5m ago
To note, it is surprisingly refreshing to completely forgo instanciable classes on a modern codebase.

Phpstan deals well with type definitions, arrays are powerful enough to contain whatever needed, and functions can be stored and passed around easily enough.

On The <dl>

https://benmyers.dev/blog/on-the-dl/
164•ravenical•3h ago•51 comments

Oura says it gets government demands for user data

https://this.weekinsecurity.com/oura-says-it-gets-government-demands-for-user-data-will-it-share-...
75•donohoe•2h ago•37 comments

80386 Microcode Disassembled

https://www.reenigne.org/blog/80386-microcode-disassembled/
136•nand2mario•4h ago•22 comments

z386: An Open-Source 80386 Built Around Original Microcode

https://nand2mario.github.io/posts/2026/z386/
34•wicket•1h ago•5 comments

Making Deep Learning Go Brrrr from First Principles

https://horace.io/brrr_intro.html
81•tosh•4h ago•30 comments

PHP's Oddities

https://flowtwo.io/post/php%27s-oddities
14•thejoeflow•3d ago•12 comments

Lisp in Vim (2019)

https://susam.net/lisp-in-vim.html
13•whent•1h ago•3 comments

The Art of Money Getting

https://kk.org/cooltools/book-freak-210-the-art-of-money-getting/
34•dxs•3h ago•11 comments

Highest Random Weight in Elixir

https://jola.dev/posts/highest-random-weight-in-elixir
24•shintoist•2d ago•0 comments

The FBI Wants 'Near Real-Time' Access to US License Plate Readers

https://www.wired.com/story/security-news-this-week-fbi-license-plate-reader-real-time-access/
60•Brajeshwar•2h ago•27 comments

Shipping a laptop to a refugee camp in Uganda

https://notesbylex.com/shipping-a-laptop-to-a-refugee-camp-in-uganda
601•lexandstuff•18h ago•208 comments

Solving the “Zork” Mystery

https://www.dpolakovic.space/blogs/zork-part2
27•dpola•3d ago•12 comments

Why Japanese companies do so many different things

https://davidoks.blog/p/why-japanese-companies-do-so-many
782•d0ks•1d ago•372 comments

I Miss Terry Pratchett

https://www.mahl.me/blog/the-spell-that-wouldnt-leave/
207•gorgmah•3h ago•178 comments

Improving C# Memory Safety

https://devblogs.microsoft.com/dotnet/improving-csharp-memory-safety/
90•soheilpro•1d ago•13 comments

Rubish: A Unix shell written in pure Ruby

https://github.com/amatsuda/rubish
120•winebarrel•9h ago•76 comments

BambuStudio has been violating PrusaSlicer AGPL license since their fork

https://xcancel.com/josefprusa/status/2054602354851254330
306•Tomte•7h ago•108 comments

A 1955 Los Alamos computer experiment changed our understanding of chaos

https://www.lanl.gov/media/publications/1663/science-of-unpredictability
31•LAsteNERD•3d ago•3 comments

The quadratic sandwich

https://fedemagnani.github.io/math/2026/04/08/the-quadratic-sandwich.html
103•cpp_frog•3d ago•8 comments

Microsoft starts canceling Claude Code licenses

https://www.theverge.com/tech/930447/microsoft-claude-code-discontinued-notepad
395•robertkarl•22h ago•374 comments

US tech firms share Dutch regulator officials' names with Senate

https://www.dutchnews.nl/2026/05/us-tech-firms-share-dutch-regulator-officials-names-with-senate/
162•zqna•5h ago•114 comments

Project Glasswing: An Initial Update

https://www.anthropic.com/research/glasswing-initial-update
486•louiereederson•20h ago•291 comments

ArcBrush – Node-based 2D image editor

https://arcbrush.com/
54•NatKarmios•3d ago•15 comments

- -dangerously-skip-reading-code

https://olano.dev/blog/dangerously-skip/
24•fagnerbrack•6h ago•20 comments

Yeunjoo Choi from Igalia on Chromium

https://theconsensus.dev/p/2026/05/20/yeunjoo-choi-from-igalia-on-chromium.html
49•eatonphil•3d ago•11 comments

Fast Factorial Algorithms

http://www.luschny.de/math/factorial/FastFactorialFunctions.htm
30•nill0•3d ago•8 comments

CISA tries to contain data leak

https://krebsonsecurity.com/2026/05/lawmakers-demand-answers-as-cisa-tries-to-contain-data-leak/
242•speckx•23h ago•54 comments

Sleep research led to a new sleep apnea drug

https://temertymedicine.utoronto.ca/news/how-decades-sleep-research-led-new-sleep-apnea-drug
208•colinprince•18h ago•121 comments

Blood Pumping Mechanism of the Hoof (2020)

https://horses.extension.org/blood-pumping-mechanism-of-the-hoof/
106•thunderbong•3d ago•40 comments

Deno 2.8

https://deno.com/blog/v2.8
393•roflcopter69•1d ago•163 comments