this post was submitted on 05 Apr 2025
141 points (88.1% liked)

Programmer Humor

22263 readers
354 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 5 points 3 days ago (1 children)

In PHP it exists as well. I try to use PHP_EOL but when I'm lazy I simply do "\n".

[–] [email protected] 1 points 2 days ago (1 children)

For me the answer is “Building backend applications with it instead of CLI applications, like Lerdorf intended.”

But also "\n" because it's easier and PHP_EOL is just an alias for "\n"; it's not even platform-dependent.

[–] [email protected] 2 points 2 days ago (1 children)

PHP_EOL depends on your host system, it's \r\n on Windows.

I don't really want to use what Lerdorf intended, PHP <= 4 was horrible, 5.x was mainly getting slowly rid of nonsense and with 7.x PHP started its slow path of redemption and entered its modern era.

While Lerdorf's vision was great at that time for its intended use case, I wouldn't want to build anything serious in it.

[–] [email protected] 1 points 2 days ago

It actually outputs "\n" on a Windows system, but modern Windows to recognise that as enough of a newline, nowadays.

I don't really want to use what Lerdorf intended, PHP <= 4 was horrible

Actually a great point!